Not sure if my topic suits this category but I didn’t find any category related to Tasklist.
Is it possible using Tasklist API (currently we use GraphQL implementation but will move to REST calls) to retrieve all tasks filtered by specific process variable?
I’m asking because we need to get tasks only for the specific user in our custom tasklist implementation but UserID is our custom process variable so we can not use assignee param as our UserId is not in Camunda itself.
Thanks for reaching out about this. We in fact have a feature aimed for 8.3.0 release about filtering tasks by process variables (also by task variables in a more dynamic way).
One suggestion would be to use the “candidateUsers” field - this field should be used to filter what users are candidates to assign/complete the tasks and it accepts a list of strings, so you could send your own id to it and later filter using it using the search method.
And here the candidateUser that you could use to filter your tasks by a custom userId:
To create a task with a candidateUser, in your process you would have to assign properly your process variable containing your custom Id to the candidateUsers field - for that you need to use the Assignment properties: