<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to access the previous task assignee(user or group) in the subsequent Service Task? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-the-previous-task-assignee-user-or-group-in-the/m-p/35255#M14860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement when the task is about to be due send an email notification to the user or group Assignee.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String dueTaskId = (String) execution.getVariable("dueTaskId");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I get the Task using below:&lt;/P&gt;&lt;P&gt;Task appTask = taskService.createTaskQuery().taskId(&lt;SPAN&gt;due&lt;/SPAN&gt;&lt;SPAN&gt;TaskId&lt;/SPAN&gt;).singleResult();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now from the above appTask variable I can get the assignee using: appTask.getAssignee();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this gives me the USER the task is assigned to and not the GROUP, if the task was not yet claimed.&lt;/P&gt;&lt;P&gt;What if I need to get the group the task was assigned to? a scenario where the task is yet to be claimed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any inputs would be appreciated.... Thank you in advance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Oct 2017 18:56:31 GMT</pubDate>
    <dc:creator>paiyyavj13</dc:creator>
    <dc:date>2017-10-25T18:56:31Z</dc:date>
    <item>
      <title>How to access the previous task assignee(user or group) in the subsequent Service Task?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-the-previous-task-assignee-user-or-group-in-the/m-p/35255#M14860</link>
      <description>Hi,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 JavaDele</description>
      <pubDate>Wed, 25 Oct 2017 18:56:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-access-the-previous-task-assignee-user-or-group-in-the/m-p/35255#M14860</guid>
      <dc:creator>paiyyavj13</dc:creator>
      <dc:date>2017-10-25T18:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to access the previous task assignee(user or group) in the subsequent Service Task?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-the-previous-task-assignee-user-or-group-in-the/m-p/35256#M14861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I digged a bit deep and noticed that I could use taskService.getIdentityLinksForTask() to get the group info that I needed from within the JavaDelegate Class I was in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works for me...! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2017 21:11:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-access-the-previous-task-assignee-user-or-group-in-the/m-p/35256#M14861</guid>
      <dc:creator>paiyyavj13</dc:creator>
      <dc:date>2017-10-25T21:11:18Z</dc:date>
    </item>
  </channel>
</rss>

