I would like to prevent an INCIDENT from being re-opened by email after being closed for 7 days

Hola Ola
Giga Guru

Hello, 

We currently have an email that goes out to Users when their case is closed. There's a link in the email that the User can click to reopen the case if not satisfied with the resolution.

As is, the link is allowing the case to be re-opened even if the case has been closed for any period of time.

Not sure which exact Business Rule makes this happen BUT I would like to make it that the case CAN NOT be re-opened after 7 days. If possible, maybe trigger a NEW case to be opened instead?

I am not skilled in scripting and would appreciate any type of help on this.

Thank you.

3 REPLIES 3

Paul Curwen
Giga Sage

I would strongly recommend you do not allow reopening of a Closed incident, but do allow users to reopen Resolved Incidents x business days after it is put into the Resolved state and before it closes. 

Take a look at the docs here:

https://docs.servicenow.com/en-US/bundle/sandiego-it-service-management/page/product/incident-manage...

 

OOTB Incidents will auto close after x days. This is set by this system property: glide.ui.autoclose.time

There is an scheduled job called Autoclose Incidents that checks every hour to for any incidents that should be auto closed.

If you want to customise how it works this is  useful article explaining how this can be done: 

https://hishowcase.service-now.com/kb?id=kb_article_view&sysparm_article=KB0552820

You can also access the above properties under Administration > Incident Properties: 

find_real_file.png

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

scott barnard1
Kilo Sage

Hi Hola

Check your inbound actions

System Policy>Email>Inbound actions

 

Filter by table for incident and you should find an Update one, a New  and a Forward.

In the actions of your Update one there will be a block similar to the following:

// if the email was generated by the approve client email (header contains approve) and the email is resolved then close it
				if (email.subject.toLowerCase().indexOf("approve") >= 0 && current.incident_state == '6') {
					current.incident_state = "7";
				}
				
				// if the email was generated by the reject client email (header contains reject) and the email is resolved then then set it to assigned
				if (email.subject.toLowerCase().indexOf("reject") >= 0 && current.incident_state == '6') {
					current.incident_state = "3";
					current.work_notes = gs.getMessage("Caller has rejected the resolution of this incident");
				}

You can add further conditions to prevent an update if the state is closed. Then you can also generate a new incident using the current values. Not the incident states above may not match yours

 

This area tends to get a lot of customisation but hopefully this puts you on the right track

 

I our case we generate an event that fires a mail to tell them they can't reopen a closed incident and to raise a new one etc. We have a 7 day gap from resolve to close

 

Regards

Hello Scott,

Thanks for your response to my email, which I find helpful. 

I do however have a favor to ask, since I'm not in any way proficient in scripting.

 

We are set up to Close a Resolved Incident in 7 days ..... but somehow, a Closed Incident was Re-Opened after it closed;


find_real_file.png

This is the Script in my Inbound Email Actions;

gs.include('validators');

if (current.getTableName() == "incident") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;

if (gs.hasRole("itil")) {
if (email.body.a

 

ssign != undefined)
current.assigned_to = email.body.assign;

if (email.body.priority != undefined && isNumeric(email.body.priority))
current.priority = email.body.priority;
}

current.update();
}

find_real_file.png

 

Is there something in/on here that allowed that CLOSED Incident to re-open?

 

find_real_file.png

 

I thank you for your time and assitance.