Get all users in a group using code on an embedded form

Hello all Camundos

Camunda 7.10 CE full distribution

Use case : An administrator uses a UserTask to assign a subsequent UserTask to a specific clerk. In order to do so the administrator has to select the clerk from a select box on the form.

My difficulty : I’m trying to populate a select box with all the users in a specific group, groupClerks. Neither camForm.client.resource(‘group’) nor camForm.client.resource(‘user’) has the functionality to return all users in the group. How can I get the list of users from code on the form, ie cam-script?

Any assistance will be much appreciated.

I responded to your other question here, and I assume these are related to the same issue:

There may be an easier way to associate a list-type object with an angular control, etc., and have it automatically render the list, but I’m not an angular developer so I generate my dynamic HTML the hard way as noted in the above response.

Hello Daniel

Yip, you’re right, the 2 posts are related.

After this post I came across the Java API method of getting all users in a group. I have no Java experience so I then constructed a JS version of it using the ‘execution’ variable :

var oUsersInGroup = execution.getProcessEngineServices().getIdentityService().createUserQuery().memberOfGroup(“camunda-admin”).list();

The problem is that I end up with a Java ArrayList datatype which is unknown to JS. How do I deserialize it into JSON?

I have uploaded a working example in the other thread.