Problem with "currentUserGroups()" expression

Hi everyone,

So… I’m trying to request list of tasks from the REST API, but when I try to use the “candidateGroupExpression” criteria with the “${currentUserGroups()}” value, it returns an “java.lang.IllegalArgumentException: argument type mismatch”.
While debugging I saw that the expression returns a list of groups, but it tries to apply the value to the “taskCandidateGroup” method, which only accepts a String argument…

Shouldn’t this apply the value to the “taskCandidateGroupIn” method?

The “candidateUserExpression” with the “${currentUser()}” works as predicted.

Thanks in advance,
Pedro Silva

Hi @pmanu93,

currentUserGroups() function returns list of Strings.
Because of that candidateGroupsExpression should be used with it instead of candidateGroupExpression.

In candidateGroupsExpression, expression must evaluate to java.util.List of Strings

But in candidateGroupExpression, expression must evaluate to String.

1 Like

You’re right!! (but I didn’t knew about that criteria… is that in the docs? -.-’)

Anyway… thank you very much. It works now :slight_smile: