Get user info

Hi everyone
I am trying to get user info based on userId via groovy script task that is as below:

def query= execution.getProcessEngineServices().getIdentityService().createUserQuery().userId​(“demo”);

but i got the following error :

Cannot instantiate process definition getuserinfo:17:121025f9-5a7e-11ec-9caf-eef635622a24: Unable to evaluate script while executing activity ‘Activity_1kz8qpe’ in the process definition with id ‘getuserinfo:17:121025f9-5a7e-11ec-9caf-eef635622a24’: groovy.lang.MissingMethodException: No signature of method: org.camunda.bpm.engine.impl.identity.db.DbUserQueryImpl.userId​() is applicable for argument types: (java.lang.String) values: [demo]
Possible solutions: userId(java.lang.String), userIdIn([Ljava.lang.String;), getId(), getIds(), userEmail(java.lang.String), use([Ljava.lang.Object;)

can anyone help me with this issue?
thanks

Are you sure you’ve used the proper quotation marks?

yes I did, this is its bpmn model

diagram_1.bpmn (3.1 KB)

I see weird bytes (e2, 80, 8b) after “userId” and before “(”. What are they for?

Hi @mrdavoodi64,

you have to attach a .singleResult() to execute the query and get the result.

Hope this helps, Ingo

HI @Ingo_Richtsmeier

Thanks for the solution. It works now.