How to set repeat interval for scheduled job based on condition?

poojashah27
Giga Guru

i would like to run send out email on last saturday of the month, how can i achieve that using scheduled job?

thanks

1 ACCEPTED SOLUTION

Hi Pooja,



Step 1, create an event. Event Registry - ServiceNow Wiki


Step 2: Create your scheduled job script. The scheduled job will only trigger an event if it meets the criteria I specified above "it is saturday, and it is the last saturday." Use gs.eventQueue() to trigger the event. GlideSystem - ServiceNow Wiki


Step 3: Create a notification that reacts to the event. Events and Email Notification - ServiceNow Wiki


View solution in original post

13 REPLIES 13

thanks Chuck. elevating role helped to run scripts in background.


Let me know if I have answered your question. If so, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.


If you are viewing this discussion from your "inbox", use the "mark as correct" option under actions. If you are viewing it directly from the thread use the Correct Answer link (red with a star).


Thank you


Sandeep132
Kilo Sage

Hi Pooja,



You can try running a script in the scheduled job and call a event to trigger. So when the event is triggered you can generate the email notification.



Thanks,


Sandeep


Thanks Sangun, i will give it a try