Filter tasks based on task variable broken?

Hi all,

Is there a bug in the camunda 7.5 filter logic? I’m in the front-end trying to filter a task based on a variable but no results are shown. Response is always the same
{"_links":{},"_embedded":{},"count":0}

task;

filter;

I’ve tried both equals and like operator
[{name: “contractType”, operator: “eq”, value: “B2B”}]
[{name: “contractType”, operator: “like”, value: “%B2B%”}]
[{name: “contractType”, operator: “like”, value: “%2%”}]

Kind regards

Hi @nvanbelle,

  1. Could you please post the JSON body of the request that is made by the tasklist for this query?
  2. Could you please post the result of the REST query GET /task/{id}/localVariables for a task that you expect to match the query?

Thanks,
Thorben

Hi thorben,

  1. Any of these did not work. POST request body:

    [{name: “contractType”, operator: “eq”, value: “B2B”}]
    [{name: “contractType”, operator: “like”, value: “%B2B%”}]
    [{name: “contractType”, operator: “like”, value: “%2%”}]

 "contractType": {
    "type": "String",
    "value": "B2B",
    "valueInfo": {}
},

Kind regards,
Nico

Hi Nico,

When I perform this request for a task:

POST http://localhost:8080/engine-rest/task/07041053-2427-11e6-a280-c82220524153/localVariables

{ "modifications": {"contractType": {"type": "String", "value": "B2B", "valueInfo": {}}}}

and then define the filter like you did in your first try, then the task is returned.

Is there anything different in your scenario? For example, is the variable local to the task? Is the task visible in the filter you use in tasklist?

Cheers,
Thorben

Ok… My penny dropped a little too late on this one :snail: My apologies.

The information was indeed stored on the process instance scope, not on the task scope.

I only tried Task variable and Case variable, I did not notice there also was a Process variable filter…

What is Case variable for then?

Case Variables is for variables set in a CMMN case instance that the user task belongs to. That is similar to Process Variables for BPMN processes.