Copy Assignment group from SCtask to RITM for parallel SC Tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 09:21 AM
Hi All,
We have a requirement to copy the assignment group on the SC Task to the corresponding RITM.
In case of multiple tasks, when the 1st task is closed, the the assignment group of the 2nd open task should be reflecting as the assignment group of the RITM. If all the tasks are closed then the assignment group of the RITM should be empty value. The following script is working for Sequential tasks but not for parallel tasks.
For a particular catalog item, one task is created and the assignment group is reflecting as per script, but when that task is closed, then 2 parallel tasks are created and the assignment group on ritm is emptied as per the 1st task closure and the script is not considering the remaining 2 parallel tasks created.
Could you please help with the issue in the script:
Business rule : After insert/update :
var gr_item = new GlideRecord('sc_req_item');
gr_item.addQuery('sys_id', current.request_item);
//current.orderByDesc('closed_at');
gr_item.query();
while (gr_item.next()) {
if (current.active == true) {
gr_item.assignment_group = current.assignment_group;
gr_item.update();
} else {
gr_item.assignment_group = " ";
gr_item.update();
}
}
})(current, previous);
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 11:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 01:48 AM
hi @Danish Bhairag2 - the above script is also not working. The Assignment group is copied from the first task and then when the first task is closed, then the assignment group on ritm is getting cleared . It is not taking the 2nd tasks value at all.
Thank you