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

@Nagashree5 

Glad to know.

Would you mind marking my response as correct if I answered your original question?

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

@Nagashree5 

you can use onLoad client script and use g_form.removeOption() to remove that choice value

 

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

@Ankur Bawiskar , sure, will this client script affect the schedule job to set the state to closed after being resolved for 2 days. Because I can see that the state is looking like below when it is closed through script.

Nagashree5_0-1681379052161.png

Any alternative for this? Is there any way to just show the closed option in the drop-down, but not let the user select it manually?

Please guide me, Thank you in Advance.