2nd task assignment group based upon the first task assignment group

Arun Priya
Tera Contributor

In a RITM the 1st task is created based upon the request type choices the assignment group is given. When it is closed completed and second task is created. It has to be assigned to  the assignment group of 1st task in the workflow.

4 REPLIES 4

Sunnyr3008
Tera Contributor

Hello @Arun Priya ,

 

Please compose the script in the workflow activity of the catalog task to retrieve the assignment group of the initial task and assign the same group to the second task.

var grtask=new GlideRecord('sc_task');
grtask.addEncodedQuery('state=3^parent='+current.sys_id);
grtask.query();
if(grtask.next()){
	task.assignment_group=grtask.assignment_group;
}

 

Sunnyr3008_0-1706811008207.png

 

Best Regards,

Sunny Rathod

Sunnyr3008
Tera Contributor

Hi @Arun Priya ,

 

Please compose the script in the workflow activity of the catalog task to retrieve the assignment group of the initial task and assign the same group to the second task.

var grtask=new GlideRecord('sc_task');
grtask.addEncodedQuery('state=3^parent='+current.sys_id);
grtask.query();
if(grtask.next()){
	task.assignment_group=grtask.assignment_group;
}

Sunnyr3008_0-1706811149048.png

 

Best Regards,

Sunny Rathod

AshishKM
Kilo Patron
Kilo Patron

Hi @Arun Priya,

You can get the assignment group from frist task and assigned the same to second task. you have to add this logic in second task's advanced section. 

check for any syntax/typo error and share the error/issue if its not working.

 

var grTask = new GlideRecord("sc_task");
      grTask.addQuery("request_item", current.sys_id); // here current.sys_id is RITM 
      grTask.query();
if(grTask.next()){
// assigned the first task's group to current task group
task.assignment_group = grTask.assignment_group;
}

 

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Hi @AshishKM 

Will try and let you know.