2nd task assignment group based upon the first task assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 09:59 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 10:10 AM
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;
}
Best Regards,
Sunny Rathod
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 10:12 AM
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;
}
Best Regards,
Sunny Rathod
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 10:24 AM - edited 02-01-2024 11:02 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 10:58 AM
Hi @AshishKM
Will try and let you know.