Help with run script in SLA workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 07:29 PM - edited 10-22-2024 07:30 PM
Hi Everyone,
I have created SLA workflow for RITM. I have created two run scripts in that workflow, :
1. When SLA completes 75% , the assignment group of RITM should be changed to another assignment group
var reqItem = current.task.request_item;
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', reqItem);
gr.query();
if(gr.next()){
gr.setValue('assignment_group' , 'ad79161133dd16506058eae13d5c7b37');
gr.update();
}
2. When SLA completes 100% then , additional comments should be added to RITM and catalog task :
var tgr = new GlideRecord('sc_task');
tgr.addQuery('sys_id',current.sys_id);
tgr.query();
while(tgr.next())
{
tgr.work_notes= "Ticket is being escalated to Triage Team. No additional actions are required";
tgr.update();
}
But these run script are not running properly, after 75% I can not see change in assignment group and after 100% I cannot see additional comments(work notes) neither in RITM nor in catalog task.
Can anyone suggest where I am making mistake.
Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 10:39 PM
Hi @Abhijit Das7, can you please check the second script. I think the second line should be (assumption SLA runs on the task which should be reassigned):
tgr.addQuery('sys_id',current.task.sys_id);
Greets
Daniel
Please mark reply as Helpful/Correct, if applicable. Thanks!