When trying to query a user task by ‘candidateUser’ I’m getting error or no results.
The error occurs when I don’t add quotation marks (") before and after the value I’m trying to search:
Failed with code 400: ‘Bad Request’. Details: ‘class ProblemDetail {
type: about:blank
title: java.lang.IllegalArgumentException
status: 400
detail: Expected to handle REST API request, but JSON property was invalid
instance: /XXXX/v2/user-tasks/search
}’
When adding the quotation marks I don’t have an error but the query doesn’t return results.
I’m doing the query in JAVA filtering by $in:
camundaClient.newUserTaskQuery().filter(userTaskFilter → userTaskFilter.candidateUser(s → s.in(“"”+candidateUser+“"”))).send().join().items())
I what to return all user tasks belonging to a specific user that’s defined in the list of users in candidate User.
Hi @Gojo and welcome to the forum.
Which version are you exactly using to test this?
I tested it with the current code from the github repository of 8.8 and it works.
Are you using the “new” native user tasks and not the ones based on the job worker implementation?
Also are you using the CamundaClient that is now provided as a unified way of accessing the Camunda REST api?
Both of those work just fine.
It seems by the method newUserTaskQuery you’re using the ZeebeClient though, where the queries are still marked as experimental.
If you really plan to use Camunda 8.8, then please use the CamundaClient, which will be the only supported client in the future.
Yes you are right. In the alpha version it’s still newUserTaskQuery, but in the current development it’s renamed to newUserTaskSearchRequest. So with the next release of a 8.8 alpha version it will change.