How to schedule job to close resolved or On Hold Awaiting Caller after 5 days
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2022 06:14 AM
Good morning guys, I would like to know what is the script for the schedule job, where when an incident is 5 days in state Resolved, or state On Hold Awaiting Caller, it is automatically closed.
So far I have nothing and I don't even know where to start, I have no experience with scripts.
Thank you so much guys!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2022 06:17 AM
hi Lucas, the easiest way is to use a flow, with a trigger condition state change to awaiting caller, then add a wait condition for 5 days, if the condition is still true, then set the record to Resolved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2022 06:38 AM - edited 11-04-2022 06:39 AM
Hi,
To find out incident resolved 5 days before you can use below condition in scheduled job or flow designer :
resolved_atRELATIVELT@dayofweek@ago@5^state=6
This is possible for resolved state because system stores resolved date. However, for On Hold Awaiting Caller case, it is not possible this way. Either you would neede to use flow designer to wait for 5 days as suggested by @lmundere or create new date-time field to store 'On Hold Awaiting Caller' state moved datetime and use above approach to find out required records.
Please mark answer as Correct or Helpful based on impact.
Regards,
Abhijit
ServiceNow MVP