Auto Close the ticket after 7 days when the state is "Awaiting Response"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 06:56 AM
Hi All,
I want to close the ticket automatically after 7 days if the state changed to "Awaiting Response" and no response received from the user, how to achieve this. Please suggest.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2025 12:52 AM
Yes, i got it, this is my use case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2025 12:20 AM
Hi @MS17 ,
write a schedule job
var gr = new GlideRecord('your_table_name');
gr.addQuery('state', 'Awaiting Response');
gr.addQuery('sys_updated_on', '<=', gs.daysAgo(7));
gr.query();
while (gr.next()) {
gr.state = 'Closed';
gr.work_notes = 'Auto-closed due to no response within 7 days.';
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 07:48 AM
this is for which table?
You can have a daily scheduled flow and check it using conditions.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 08:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 08:26 AM
then you can follow how OOB incident auto closure is done and enhance for your table
Customizing incident auto-closure
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader