how to bulk close incidents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 11:55 PM
how to bulk close incidents

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 02:24 AM
You can use sample code below and modify it according to your requirement and ran it in background script..
- var gr = new GlideRecord('incident');
- gr.addQuery('sys_updated_on', '<', <a number of days>);
- gr.query();
- while(gr.next()) {
- gr.active = false;
- gr.closed_by = gr.resolved_by;
- gr.update();
- }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 02:26 AM
Hi,
Please explain the cause,
This would be the idea:
A Job scirpt/back ground script to update the incidents that fall under this category. You may need to update the close code or close notes to do so.
Thanks,
Vinitha.K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 02:30 AM
Hi Durga,
Either you can run a background script to do the same which is already provided by Aanchal or you can create buisness rule .
This article might be helpful for you :
http://wiki.servicenow.com/index.php?title=Closing_Multiple_Incidents#gsc.tab=0
The conditions can be modified according to your requirements.
Thanks,
jyoti kumari
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 03:47 AM
Hi Durga
Please try this code:
var gr = new GlideRecord('incident');
gr.addQuery('state','resolve');
gr.query();
while (gr.next()) {
gs.print(gr.getRowCount());
gr.active=false;
gr.update();
}
I hope this will helpful
Thanks and Regards
Pavani Paluri