- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 02:44 AM
Hello everyone,
Is there any way to close the RITM requests without sending any notification. There is a requirement that we will receive a bulk of RITM's and those RITM in whichever state they are,(workflow might have many notifications) If we get the request to close the RITM tickets, No mail should be sent to requestor. Is it possible?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 06:24 AM - edited 10-19-2023 06:25 AM
Hello @deepika46 ,
Please refer below code-
var gr = new GlideRecord('sc_req_item');
gr.addEncodedQuery('numberINRITM01111,RITM01112,RITM01113,HRC01114');
gr.query();
while(gr.next()) {
var gr1 = new GlideRecord('sc_task');
gr1.addEncodedQuery('request_item='+gr.sys_id);
gr1.query();
while(gr1.next()){
gr1.setWorkflow(false);
gr1.state = '3'; // for closing
gr1.update();
}
var gr2 = new GlideRecord('sc_request');
gr2.addEncodedQuery('sys_id='+gr.request);
gr2.query();
if(gr2.next()){
gr2.setWorkflow(false);
gr2.state = '3'; // for closing
gr2.update();
}
gr.setWorkflow(false);
gr.state = '3';
gr.update();
}
Please mark my answer as helpful and Please Accept Solution.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 02:59 AM - edited 10-19-2023 03:00 AM
Do you know how are the emails getting triggered?
if it is via an event which is sent via BR then you can skip it. To do so you can user .serWorkflow(false) in your script to bulk close those, that will skip all BR for that transaction and so the events wont trigger.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 03:16 AM
Those RITM's can have notification triggered from event or through "create notification". Like there can be 100 RITM's with different logic for triggering notifications. If i get the request of cancel these tickets, then it should just go to cancelled without triggering any notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 03:17 AM
but all those notifications will be triggered from a workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 03:22 AM
Yes, using setWorkflow(false) will not trigger mails.