- 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 04:49 AM
NO mate, if condition match email will trigger.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- 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 04:57 AM
@Sohail Khilji ,
Thank you so much! Could you please let me know if
gr.setWorkflow(false);
needs to mention my notification action somewhere or will this just not allow any workflow, business rule or notification to run?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2024 05:13 AM
No, not required to mention anything, just go with the script as given.
Kindly make the answer as accept and helpful to clear the queue...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....