Auto-close a custom table incident after 2 days of being resolved.

Nagashree5
Tera Contributor

Hi All,

I have created a custom table in scoped application called "Service Desk Incidents" which is extended from Task table.I have a requirement for Auto Close these SD incidents after 3 business days(excluding sat and sun) of being resolved.

I know that we have an OOB business rule, property and scheduled job which closes incidents based on calendar days. It is not applicable for Business days. Also, do I need to create resolved at, resolved time or resolved by fields in the custom table to make this work?

Can anyone please guide me on this. 

Thank you in Advance.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Nagashree5 

you will have to customize it to handle business days

this link has the solution

Auto closure of Task after 3 business days 

also check this link where I shared solution few years ago

How to Auto close incidents in 5 working days, after incident state is resolved. 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@Nagashree5 

you will have to customize it to handle business days

this link has the solution

Auto closure of Task after 3 business days 

also check this link where I shared solution few years ago

How to Auto close incidents in 5 working days, after incident state is resolved. 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar,

Thank you for providing the links. In the second where you have provided a schedule job script, it is working fine in my scenario as well. But here, I have to check the close condition based on the "resolved at" time. so, the ticket should be closed after 3 days of resolving. But as this is custom table, "resolved at" is not there. Do I need to create this field. Can you please guide me on this.

 

Thank you in Advance.

@Nagashree5 

so how would you know when it got resolved unless you store that date/time in some field.

create a custom field to store resolved date/time and then update your script as per link shared

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar , Sure. I have created a custom field called "resolved_at" and storing the resolved time in the field. Thank you for your guidance.

I have a quick question here, can we hide the "closed" drop-down from the state field because Agent should only resolve the ticket, they should not be able to close the ticket directly. so, is there any way to hide this drop-down.

 

Thank you in Advance.