I have a requirement when the task is about to be due send an email notification to the user or group Assignee.
The way I go about is store the taskId of the- about to be due task in an execution variable and retrieve the task in the subsequent Service task using below piece of code in my JavaDelegate Class:
String dueTaskId = (String) execution.getVariable("dueTaskId");
Then I get the Task using below:
Task appTask = taskService.createTaskQuery().taskId(dueTaskId).singleResult();
Now from the above appTask variable I can get the assignee using: appTask.getAssignee();
I believe this gives me the USER the task is assigned to and not the GROUP, if the task was not yet claimed.
What if I need to get the group the task was assigned to? a scenario where the task is yet to be claimed?
I noticed that if I manage to get the DelegateTask object for the relevant taskId(instead of the Task object as mentioned above in my code), then I can manage to get the assigned group by using- delegateTask.getCandidates();
Any inputs would be appreciated.... Thank you in advance...