we have found a bug in query API, it's rather a edge case.
Here is how to reproduce:
- Design a human task with Groups attribute filled and ExcludedOwnerId set as well
Now try to look for this task using following API:
Now, we are looking for tasks only by Groups, so we don't care about User, and therefore we are setting UserId to null and only passing Groups, it looks like this:
tasks = userTaskServicesClient.findTasksAssignedAsPotentialOwner(null,Arrays.asList("SII_CHECKER"),ACTIVE_TASK_STATUSES,0,100);
So for this particular combination, when task has group as a potential owner, excluded owner is not null, and we are searching for this task with userid == null NO results are returned.
This is because of how SQL queries are written:
that particular line will be translated to this:
which is false, because of SQL three valued logic -> this is causing no results.
If I rewrite it to this:
i.e. I replaced null with empty string, it is evaluated as true, and it does return results - this is one of the possible solution engineering could try..
affects as well