Is there a way to close tickets without sending notifications?

Navaneeth1
Tera Guru

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!

1 ACCEPTED SOLUTION

Sohail Khilji
Kilo Patron
Kilo Patron

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....

LinkedIn - Lets Connect

View solution in original post

5 REPLIES 5

Amit Pandey
Kilo Sage

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