Hi there,
I want to get the task by assigned user group
task=taskService.createTaskQuery().taskCandidateGroup(“Employees”).singleResult();
Now, i can get details like
task.getId():
task.getAssignee();
But now I cannot get by
task.getCandidateGroup();
How can i get the candidate group by task
1 Like
garima
2
Hi Sai
I believe that https://docs.camunda.org/manual/latest/reference/rest/task/identity-links/get-identity-links/ might help you in retrieving the candidateGroup of a specific task.
Best Regards,
Garima
langfr
3
List<IdentityLink> identities = this.taskService.getIdentityLinksForTask( task.getId() );
for ( IdentityLink identity : identities ) {
String type = identity.getType();
switch ( type ) {
case IdentityLinkType.ASSIGNEE:
break;
case IdentityLinkType.CANDIDATE:
if ( identity.getGroupId() != null ) {
camundaTask.setCandidateGroup( identity.getGroupId() );
}
if ( identity.getUserId() != null ) {
camundaTask.setCandidateUser( identity.getUserId() );
}
break;
case IdentityLinkType.OWNER:
break;
default :
break;
}
}