- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2024 04:47 AM
I'd like to close 200 tickets but without sending any notifications. I can't disable the notifications for this process due to some conflicts.
Is there a way to write a script or any other way to update all these records without triggering the notification condition which gets triggered when the state becomes closed?
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2024 04:52 AM - edited 03-28-2024 04:53 AM
HI @Navaneeth1 ,
Here is your fix script :
var gr = new GlideRecord('incident');
gr.addEncodedQuery('numberINC0001111,'INC004543'); //pass the query for your 200 inc
gr.query();
while(gr.next()) {
gr.setWorkflow(false); // prevent notifications from going out
gr.state = '3'; // for closing , Set as per your system config
gr.update();
}
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2024 05:56 AM
Hi @Navaneeth1
You can do this with the help of background script.
var gr = new GlideRecord('incident');
gr.addEncodedQuery(); //Query for all 200 incidents
gr.query();
while(gr.next()) {
gr.setWorkflow(false); //Stops all the notifications, rules, SLAs
gr.state = '3';
gr.update();
}
Please mark my answer helpful and correct.
Regards,
Amit