Send Notification 24 Hours Prior To Planned Start Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2024 12:04 PM
Everyone,
I am trying to have a notification fire on an event when a change is 24 hours prior to the planned start date if it contains a critical system. I have created the event and scheduled job, but it does not appear to be firing. This is my first time creating a scheduled job so I am unsure if that (or my code) may be configured incorrectly.
Also in this case, would the 24 hour prior to the "Planned Start Date" portion even need to be included in my notification conditions? Or would this be something that is scripted into my scheduled job?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2024 10:15 PM
Hello @tiguin2798
2 things needs to be updated..
In your scheduled job addEncodedQuery quotation are missing and as Sanjiv said, you need to update the event name & state condition too.
//Scheduled job query
gr.addEncodedQuery("active=true^start_dateRELATIVEGT@hour@ahead@24^state=-2");
//Event as per notification
gs.eventQueue('critical.change.24.hours',gr);
Cheers!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2024 08:49 AM
Thank you everyone for your responses! I will preface my response with I do not have prior scripting experience. What I have created thus far was based off of other community post.
With this being said I have taken the replies given and attempted to update the script for my scheduled job to include the annotations as well as adding the state to the query. I also created a business rule to run after insert and update that should trigger the scheduled job. Can someone check my screenshots below and confirm that this should work as expected as I am still learning the platform?
Thank you in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2024 10:18 AM - edited ‎05-28-2024 10:18 AM
I dont think you need a scheduled item and business rule.
What you need is a scripted scheduled job and add the script in the scheduled item to the scheduled job.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2024 10:50 AM
In this case would removing the business rule and having the script in the scheduled job below suffice? Granted the script below is correct.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2024 02:01 PM
Yes..Because in the Scripted Schedule job, you can run it to job on a Daily basis. The script in the scheduled job will take care of querying the change requests and triggering the event, which will then trigger the notifications.
Please mark this response as correct or helpful if it assisted you with your question.