Sorted by a processVariable for Get task list

Please need help
Is it possible to GET task list which is sorted by a processVariable?
When I execute the list of tasks by filtering on processVariable, I get an error that has no message. Attached are the screenshots


Hi @thomey, welcome to the Camunda Forum! :slight_smile:

In the official Rest-Docs you can find all the available Camunda’s REST-APIs.

To query for tasks via Get List (POST) filtered by a certain process variable you have to define the processVariables parameter in the request body, especially when you want to sort by it, following the parameter instructions:

Array of objects or null (VariableQueryParameterDto)

A JSON array to only include tasks that belong to a process instance with variables with certain values. The array consists of JSON objects with three properties name, operator and value. name is the variable name, operator is the comparison operator to be used and value the variable value. value may be of type String, Number or Boolean. Valid operator values are: eq - equal to; neq - not equal to; gt - greater than; gteq - greater than or equal to; lt - lower than; lteq - lower than or equal to; like; notLike. key and value may not contain underscore or comma characters.

Which could look like this for your variable Identifiant.

// Body
{
    "processVariables": [
        {
            "name": "Identifiant",
            "operator": "eq"
            "value": "CM202312000000117"
        },
    ],
    // your sorting instructions..
}

Hope it helps!