Scheduled Job for change request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 05:14 AM
Hi All,
we need a scheduled job script to send a reminder mail to users before one day of start date in change request.
if the scheduled start is on Monday then the email on Friday(working day) , for remaining it should trigger the one day before.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 05:20 AM
Hello @MarripudiL
You can add the condition as shownkn below screenshots in your email notification and it will trigger.
Planned start date - relative - after - 1 Day Ago
This will trigger the email as soon as 1 day ago timeline is finished.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOw
NeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 05:29 AM
you cannot configure notification for this
For this you need to do this
1) configure daily scheduled job
2) iterate CHG
3) get the start date and subtract 1 day from that using Schedule or simply skip weekends for your calculation
4) the date which you get from Step 3 compare it with Today's date
5) if same then trigger event using eventQueue() and configure notification to trigger on that event
sharing link for step 3
Calculate Date By Adding or Subtracting Time With A Schedule
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
03-20-2025 08:06 PM
Hope you are doing good.
Did my reply answer your question?
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
03-20-2025 05:51 AM
Hi @MarripudiL ,
You can use DurationCalculator Script Include to check the difference between current Date and Start Date using Schedule.
Create one 24X7 excluding Weekend schedule and use it like below code.
var dc = new DurationCalculator();
dc.setSchedule('08fcd0830a0a0b2600079f56b1adb9ae'); // Schedule 24X7 excluding Weekends
var nowDate= new Date();
var gr = new GlideRecord('change_request');
gr.addQuery('active', true);
gr.query();
while(gr.next()) {
var diff = dc.calcScheduleDuration(nowDate , gr.start_date) / (60*60*24);
if(diff <= 1 && diff > 0) {
gs.log(gr.number); // Create event for Notifications
}
}
Kindly mark my answer as helpful and accept solution if it helped you in anyway