- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 10:12 AM - edited 02-11-2025 10:21 AM
Script for Bulk Closure of Incident Request, Requested Item and Catalog Task without sending the Closure or any other Notifications using script?
Please let me know the steps
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 12:29 PM
Before closing an incident, make sure all mandatory fields are included in the script if needed. Also, when closing a REQ, ensure that the SCTask is closed first via script. It’s better to run three separate scripts:
- One for Incident
- One for SCTask
- One for RITM/REQ
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
02-11-2025 10:49 AM - edited 02-11-2025 11:05 AM
I believe there is only one way. In the same script, you can glide the respective notification records and mark them inactive as the closure function script starts. Once the closure function ends, you can make the notifications active again. Or you can use function to mark other workflows as false before your closure function ends.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 10:59 AM
Hello @VIKASM535239375 ,
You can setworkflow(false); before gr.update(); in the script.
If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 12:29 PM
Before closing an incident, make sure all mandatory fields are included in the script if needed. Also, when closing a REQ, ensure that the SCTask is closed first via script. It’s better to run three separate scripts:
- One for Incident
- One for SCTask
- One for RITM/REQ
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
02-13-2025 09:47 AM
Below Script should work:-
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();
}