How to search Camunda process instance by variable in swagger

I used below request and got result

{
  "page": {
    "limit": 1
  },
  "sort": [
    {
      "field": "processInstanceKey",
      "order": "ASC"
    }
  ],
  "filter": {
    
    "processDefinitionId": "Process_SomeID"
  }
}

But when I use below query to filter out based on variable then I do not see results although the variable and value exists in Camunda operate:

{
  "page": {
    "limit": 1
  },
  "sort": [
    {
      "field": "processInstanceKey",
      "order": "ASC"
    }
  ],
  "filter": {
    "variables": [
      {
        "name": "respectiveVariableName",
        "value": "003322ac-24dd-430f-9fce-30cc27a4ae29-1"
      }
    ],
    "processDefinitionId": "Process_SomeID"
  }
}

The query matches the given variable and not all variables right?

What is going wrong here?

The variable value in your filter likely needs to be provided as a properly serialized JSON string (e.g. quoted), which may be why the exact match isn’t returning results. I found the following relevant resources:

Does this help? If not, can anyone from the community jump in? :waving_hand:


:light_bulb: Hints: Use the Ask AI feature in Camunda’s documentation to chat with AI and get fast help. Report bugs and features in Camuda’s GitHub issue tracker. Trust the process. :robot:

It worked after adding quotes to the value too:

"value": "\"003322ac-24dd-430f-9fce-30cc27a4ae29-1\""

So the value is somehow saved with quotes but shown in the Operate GUI as normal value without quotes.

This happens via code and also when I manually add a variable with value using Operate GUI