Notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2025 05:01 AM - edited 06-22-2025 05:03 AM
Hello Team,
I want to implement the following requirement without using Flow Designer, as it is not available in the client environment:
Send the first notification to the approver 1 day after the approval record is created, if it is still not approved.
If the approval is still pending after that, send a second reminder after 24 hours.
If no action is taken, send a final reminder after another 24 hours.
If the approval is still not completed after all three notifications, then automatically close the RITM record.
Please guide me on how this can be achieved.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2025 05:32 AM
Flow designer is available out of the box in every instance.
You should use flow wherever possible compared to scheduled job
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
06-23-2025 05:42 AM
Hi @Mark Wood ,
To meet this requirement without using Flow Designer, created a Scheduled Script Execution that runs daily. It checks if the approval is still in the "requested" state and sends reminders at 1, 2, and 3 days. If still not approved after 3 days, it auto-closes the RITM.
The script uses gs.eventQueue() to trigger custom events for notifications. Notifications are sent only if the approval is still pending. Once approved, no further reminders are sent.
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('state', 'requested'); // Only pending approvals
gr.query();
while (gr.next()) {
var createdDate = new GlideDateTime(gr.sys_created_on);
var now = new GlideDateTime();
var ageInMillis = GlideDateTime.subtract(now, createdDate).getNumericValue();
var ageInDays = ageInMillis / (1000 * 60 * 60 * 24);
if (ageInDays >= 1 && ageInDays < 2) {
gs.eventQueue('approval.reminder.1', gr, gr.sys_id, gr.approver);
} else if (ageInDays >= 2 && ageInDays < 3) {
gs.eventQueue('approval.reminder.2', gr, gr.sys_id, gr.approver);
} else if (ageInDays >= 3 && ageInDays < 4) {
gs.eventQueue('approval.reminder.3', gr, gr.sys_id, gr.approver);
} else if (ageInDays >= 4) {
var ritm = new GlideRecord('sc_req_item');
if (ritm.get(gr.document_id)) {
ritm.state = 3; // Closed
ritm.stage = 'Closed';
ritm.update();
}
}
}
If my response helped, please mark it correct and close the thread so that it benefits future readers.
Regards,
Syed K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2025 06:09 AM
Hello @Mark Wood ,
Honestly, I was a bit confused when I read that Flow Designer isn’t available in your client’s instance—like others mentioned, it’s a base feature that usually comes with every ServiceNow instance. If it’s really not available, I’d be curious to understand why—maybe some limitation or restriction from the client’s end? Definitely worth checking with the admin or team managing the instance. Would love to know what you find out.
Now coming to the actual requirement—it’s doable without Flow, but yeah, it’ll need some effort. The approach I was thinking about is creating a scheduled job that runs every hour or so. That way, you can check if the approval is still pending and then trigger your notifications at the right intervals. If you want to make it super accurate (like exactly 24 hours between reminders), you might need to make the job run even more frequently, but just keep in mind that running it too often can cause unnecessary load on the system.
So yeah, possible—but a bit of extra setup and logic compared to using Flow Designer, which would’ve handled this quite neatly with less custom effort.
Let us know what you find out about Flow Designer not being available—it might help others too who run into a similar situation.
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Regards,
Aniket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2025 03:57 AM
Hello @Mark Wood ,
Just wanted to check in to see if my earlier response helped you out or if you're still facing any issues. If your query is resolved, it would be great if you could mark my reply as helpful and accept it as the solution — that way it can also benefit others who come across the thread later.😊
Also, if you found any other responses helpful, feel free to mark those as helpful too. You can even accept multiple solutions if they contributed to resolving your issue.
Let me know if you need anything else!
Best regards,
Aniket Chavan
🏆 ServiceNow MVP 2025 | 🌟 ServiceNow Rising Star 2024
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2025 06:30 AM
Hi @Mark Wood
To trigger the reminder notification and cancel the record you can use scheduled job based on run daily.
(function() {
var gr = new GlideRecord('sysapproval_approver');
gr .addEncodedQuery('source_table=x_kpm14_business_f_fin_data^state=requested');//modify this based upon your requirement
gr.query();
while (gr.next()) {
var created = new GlideDateTime(gr.sys_created_on);
var now = new GlideDateTime();
var diff = GlideDateTime.subtract(now, created).getNumericValue(); // in milliseconds
var hours = diff / (1000 * 60 * 60);
if (reminderCount == 0 && hours >= 24) {
// First reminder
gs.eventQueue('approval.reminder1', gr, gr.sys_id, gr.approver);
} else if (reminderCount == 1 && hours >= 48) {
// Second reminder
gs.eventQueue('approval.reminder2', gr, gr.sys_id, gr.approver);
} else if (reminderCount == 2 && hours >= 72) {
// Final reminder
gs.eventQueue('approval.reminder3', gr, gr.sys_id, gr.approver);
// Auto-close the RITM
var ritm = new GlideRecord('sc_req_item');
if (ritm.get(gr.document_id)) {
ritm.state = 3; // Closed Incomplete or appropriate state
ritm.stage = 'Closed';
ritm.update();
}
}
}
})();
Stay awesome,
Roshnee Dash