notification based on due date using scheduled job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 12:54 AM
Hi All,
I have a requirement to send a notification based on due date. Notification should be triggered when the due date is less than 45 minutes meaning 45 minutes before the due date. If the due date is at 2:50AM then the email notification should be triggered at 2:05AM same day. Please help me with the scripting, I am new to the scripting.
Also there are 2 notifications
1. when the Assigned to is not empty
2. when the Assigned to is empty
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 08:44 AM
Hi @unknown ,
Do the following.
1. Create a schedule job with below script.
var gr = new GlideRecord('change_request');
gr.addEncodedQuery('due_dateRELATIVELT@minute@ago@45');
gr.query();
while (gr.next()) {
gs.eventQueue('your event name', gr, gr.assigned_to, '');
}
2. Create event based notification: you can get help from here in case you dont know: https://servicenowwithrunjay.com/email-notification/
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------