- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 06:30 AM
i would like to run send out email on last saturday of the month, how can i achieve that using scheduled job?
thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 08:19 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 06:33 AM
Here's how I would approach it..
Run the script every day.
Use the GlideDateTime methods to find out if the day of week is Saturday (6).
Find out if adding 7 days gives you a result with a new month value, if so, you're on the last Saturday.
GlideDateTime - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 06:50 AM
I should have mentioned, if it is the last Saturday, trigger an event that launches the email notification.
Email Notifications - ServiceNow Wiki
Events and Email Notification - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 08:15 AM
Thanks Tom. So as per my understanding i should do following:
1. create schedule item
job ID: RunScriptJob
trigger type: Daily
2. create email notification
what should i choose an option here?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 08:19 AM
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