User task query for assigned or candidate tasks


I am using the or() method of TaskQuery to find all tasks that have been either assigned to a user or which he is a candidate for:"assigned tasks {}", taskService.createTaskQuery().taskAssignee(user).count());"candidate tasks {}", taskService.createTaskQuery().taskCandidateUser(user).count());"assigned or candidate tasks {}", taskService.createTaskQuery().or().taskCandidateUser(user).taskAssignee(user).endOr().count());

[info] application - assigned tasks 14
[info] application - candidate tasks 2
[info] application - assigned or candidate tasks 0

I expected the last query to include all 16 tasks, how to achieve that?


yeah smells buggy, i get a result, which is inconsistent, by using the same syntax you are using:

//this is groovy
String userName='admin'
int assignedTasks = taskService.createTaskQuery()

int candidateTasks =  taskService.createTaskQuery()

println "User assigned (" +assignedTasks + "), user candidate (" + candidateTasks + "), User " + userName + " has in total tasks: " + 

and a result is:

User assigned (18), user candidate (2), User admin has in total tasks: 17

I tried a rest api:

with post:

  "orQueries": [

gave me back the same wrong number of tasks 17. loosing couple of assigned tasks in the middle…


Thanks for reproducing the problem. A bummer, we were quite excited about that new or() method. Will have to do multiple queries then or hit the database.


You can follow