How to check the due date is seven days from now for a ticket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
How to create a script to check the due date is seven days from now for a ticket and trigger a reminder notification using the schedule job.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
use flow designer:
https://www.servicenow.com/community/developer-forum/flow-designer-reminder-emails/m-p/2413189
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
I shared working solution few years ago using flow designer with 3 days, you can enhance it for 7 days
how to send email notifications prior or 3 days befor valid date automatically
sharing again here
Do remember to save and Activate the Flow
example below:
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Hi @Tamilvanan T !!
You can achieve this by using a Scheduled Script Execution that checks records whose Due date is exactly 7 days from today and then triggers a notification (event).
1)Create a Scheduled Script Execution
Navigate to:
System Definition → Scheduled Jobs → Scheduled Script Executions
Run: Daily (recommended)
Active: ✔
2) Scheduled Job Script Example
(function () {
var gr = new GlideRecord('task'); // or incident/change/etc
gr.addNotNullQuery('due_date');
// Due date exactly 7 days from now
var start = gs.daysAgoStart(-7);
var end = gs.daysAgoEnd(-7);
gr.addQuery('due_date', '>=', start);
gr.addQuery('due_date', '<=', end);
gr.query();
while (gr.next()) {
// Trigger event for notification
gs.eventQueue(
'task.due.reminder',
gr,
gr.assigned_to,
gr.number
);
}
})();
- This checks for records whose due date is 7 days from today
- Runs once per day
- Avoids duplicate reminders if scheduled correctly
3) Create an Event
Go to:
System Policy → Events → Registry
Name: task.due.reminder
Table: task
4) Create a Notification
Navigate to:
System Notification → Email → Notifications
Table: task
When to send: Event is fired
Event name: task.due.reminder
Recipients: Assigned to / Group / Manager (as required)
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for.
Thank You
