close multiple incidents without sending email notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2018 11:35 AM
hello
I would like to know how can we achieve this in the best possible way.
Knowing that via backround script but according to my understanding Will it not affect system performance?
Any thoughts are welcome.
Regards,
Nikita Khavnekar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2018 03:11 PM
You could do a background script, but write the logic so that you batch a few records. Also add in sleep(); calls to improve performance, as I'm sure it's not extremely time sensitive to bulk close items. Also, set setWorkflow(false) to prevent BR/notifications.
var gr = new GlideRecord('incident');
gr.setLimit(100); //will update 100 records at a time
gr.addQuery('active', 'true');
gr.query();
while(gr.next())
{
gr.short_description = 'test';
gr.setWorkflow(false); //Will not fire BR/email notifications
gr.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2018 03:12 PM
Also since the background script runs as the given user, you could also add logic to the email notification so that updated by != that user to ensure no emails trigger.