- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 11:42 PM
I want to cancel the incident in bulk but notification should not trigger to the assignment group for this process. I am using following script to cancel the INC.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 12:00 AM
set it cancel via script
var gr = new GlideRecord('incident');
gr.addEncodedQuery("numberININC0535119");
gr.query();
while(gr.next()) {
gr.state = '8';
gr.assignment_group = "874500c8db99af001ce298f3db9619e3";
gr.assigned_to = "12665d45dbacd300ebd7f3361d9619fe";
gr.business_service = "ef19a128dba86b003700ff361d961966";
gr.work_notes = "Canceling the change as per ----------";
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.update();
// Manually stop SLAs
var slaGR = new GlideRecord('task_sla');
slaGR.addQuery('task', gr.sys_id);
slaGR.query();
while (slaGR.next()) {
slaGR.setValue('stage', 'cancelled'); // cancel SLA
slaGR.update();
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 01:37 AM
can you share what do you mean by SLA timer is still running? share screenshot
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 01:46 AM
I am reffering to actual elapsed time and business elapsed time as highlighted in image. These times are still running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 01:50 AM
are they getting refreshed? did you reload and see if the value got updated
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 01:56 AM
@Ankur Bawiskar
Yes I can confirm, they are getting updated, as I am continuously monitoring and reloading them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 02:01 AM
In my case the time has stopped and it doesn't refresh.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader