candidateUsers or candidateUserIn

Hi,

Is there an equivalent of candidateUsers or candidateUserIn search methods for tasks? We have been able to find methods that support an array of items that gets or’d except for candidate users.

Cheers,
Simon

@simon2 “in” query is supported only for candidateGroups.

If you have multiple candidate users then you can use the candidateGroups itself instead candidateUsers .

Otherwise, maybe you can try like this using or() query:

 Task task = taskService.createTaskQuery().processDefinitionKey(processDefinitionKey)
                  .processInstanceBusinessKey(processInstanceBusinessKey)
                  .processInstanceId(processInstanceId).or()
                  .taskCandidateUser("user1").taskCandidateUser("user2").endOr()
                  .singleResult();

Thanks for the response and snippet @aravindhrs

We are using the REST API and can’t work out how to use the OR query with multiple candidateUsers.

I thought something like this would work but it seems to ‘and’ the users and get no results
{
“orQueries”: [
{
“candidateUser”: “user1”
},
{
“candidateUser”: “user2”
}
]
}

It looks like the syntax to make it OR is like this but this doesn’t work because the same key exists twice in the object

{
“orQueries”: [
{
“candidateUser”: “user1”,
“candidateUser”: “user2”
}
]
}

Any ideas on how to query for tasks assigned to an array of candidate users from the REST API?