Send Notification 24 Hours Prior To Planned Start Date

tiguin2798
Tera Guru

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?

tiguin2798_0-1716577437749.pngtiguin2798_1-1716577443265.pngtiguin2798_2-1716577444848.png

 

11 REPLIES 11

Bert_c1
Kilo Patron

Try adding:

 

 

gs.info("24 Hour Critical Event Notification scheduled jog is running"); 

 

 

And check Script log statements for the message, should appear ever minute based on the scheduled job Repeat settings you have. And maybe change the event condition to leave out the check for "Planned start date".

 

I'm sure others here will post suggestions.

SanjivMeher
Kilo Patron
Kilo Patron

In the notification, you dont need the planned start date condition.

In the scheduled job, you need to specify the event name that you are triggering.

so it would be

gs.eventQueue('critical.change.24.hours',gr);

Also in while querying the change request in scheduled job, you should addQuery to query state = Scheduled, so that you dont trigger event for unwanted changes and also limit the scope to the scheduled changes only.


Please mark this response as correct or helpful if it assisted you with your question.

MG Casey
Mega Sage

In your first screenshot, the query of "start_dateRELATIVEGT" is not surrounded by apostrophes.

Raj118
Tera Contributor

Hello,

Need clarification on the scheduled job. When are you running it ? This seems to be the problem. If you are running the job everyday and looking for changes that are planned 24 hrs ahead may not give you correct results based on the timing of your scheduled job.

 

I would do something like this:

1. Create a BR on the change record based on state (if you want to filter the by state). Write filter conditions for critical systems. Account for planned date changes as well(cancel or update scheduled job based on planned date change)

2. Trigger scheduled job from the BR and set trigger to run 24 hrs prior to the planned implementation time.

3. Scheduled job triggers event.

4. No need of additional conditions in your notification.

 

Hope you find this helpful.

 

Thanks!

Raj