Auto close resolved incidents after 7 business days

chaitusnow
Mega Contributor

Hi All,

I have a requirement for Auto Close incidents for 7 business days.

I know that we have an OOB business rule which closes incidents based on calendar days. It is not applicable for Business days.

Can any one share the information or code for auto closing incidents for 7 business days.

Regards,

KVC.

8 REPLIES 8

Brian Lancaster
Tera Sage

The business rule by itself does not close the incidents.  First you must set a system property called glide.ui.autoclose.time to the number of days you want to auto close the incident.  Then every hour this business rule is called by a scheduled job (Autoclose Incidents).  My thought would be to add code to the scheduled job so it does not run on Day 0 (Sunday) or Day 6 (Saturday).  The below code will get you the day of the week.

var now = new Date();
var day = now.getDay();

Hi Brian,

 

Yes its correct to to eliminate Saturday and Sunday. But i need it to take from schedules because we will also have holiday schedules and others.

 

Thanks.

I would have to say this is not best practice.  7 days is a lot and just excluding Sat and Sundays would mean a user could have up to 11 days to reopen a incident.  Incident management best practice says 3 days would be how long a user should have to reopen an incident.  Having up to 7 days could cause a user to reopen an incident if the issue happens again and then you would never be able to trend on this.  Which means you could potentially not find a system issue as you cannot tell it is reoccurring since you are not getting a new incident.

Ajaykumar1
Tera Guru

Hi

Following article might be helpful.

Customize the automatic closure of incidents

 

Mark if Correct/Helpful.

Regards,
Ajay