Auto close Incidents after 14 days?

Karlie
Tera Contributor

Looking for the best way to auto close an Incident after 14 days of being in the state of awaiting user info. We started doing it with an incident inactivity monitor and put the reset conditions to have the incident state be closed. That is not working. Does anyone know what the reset conditions are supposed to do on incident inactivity monitors? Thanks!

6 REPLIES 6

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi Karlie,

Please do the following:

If you have an inactivity monitor firing on your incident, it resets this auto-close clock each time it fires, preventing your incident from being closed. To prevent this reset, put a Reset Condition on your inactivity monitor of [Incident state] [is not] [Resolved].

Please read the documentation for any more information.

Hope this will fix your problem.

Please, remember to mark Correct or Helpful if you find my response useful.

Cheers
Alberto

I am trying to have it close as soon as it hits 14 days of being in the state of awaiting user info. Reading that link you sent...it doesn't seem like an incident inactivity monitor is the way to go. Have you had an experience is auto closing incidents?

Try to use this script, just changing the state code accordingly:

var query = "state=6^opened_at<javascript:gs.beginningOfLast14Days()" ;
var gr = new GlideRecord('incident');
gr.addEncodedQuery(query);
gr.query();
while(gr.next()) {

gr.incident_state = 7 ;// PUT THE STATE VALUE OF CLOSED HERE
gr.active = false;
gr.closed_by = gr.resolved_by;
gr.update();
}

Please, remember to mark Correct or Helpful if you find my response useful.

Cheers
Alberto

What if an incident has been opened for longer than 14 days but was only put in awaiting user info for one day?