- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 04:32 AM
I have a number of tasks that I am looking to assign to IT members using scheduled jobs in Service Now. I would like to create a monthly schedule that will run on the first Monday of every month as most do not work on weekends. Has anybody had success creating a schedule like this?
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 02:20 PM
Right, but the requirement is for the first Monday of the month. The isFirstDayOfWeek method simply tells you if it is a Monday or not.
This condition should work:
new Date().getDay() == 1 && new Date().getDate() <=7
It checks to see if it is a Monday (new Date().getDay() == 1) and if it is less than or equal to 7 days into the month (new Date().getDate() <=7).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 04:53 AM
Hi Tyler,
What you can do is, create a scheduled job to run daily, then check the conditional checkbox and give the condition like this:-
var answer=gs.isFirstDayOfMonth(gs.now());
answer;
I have never tried this, you might want to test before you implement this.
Regards,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 08:35 AM
Thank you very much for your quick reply!
I have to apologize I am not very experienced with scripting. If I use this as the condition, what happens if the first Monday of the month is actually the 3rd. and Saturday was the 1st?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 09:24 AM
Now I understand. Sorry.
You would need to make a condition that checks if its a Monday (isFirstDayOfWeek(Object)) and that the date is 1-7 (this way it will only fire on the 1st Monday)
This second part can be maybe with getDayOfMonth().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 01:11 PM
It should work ideally, as per wiki-
isFirstDayOfWeek(Object)
Checks whether the date is the first day of the week. This uses the ISO standard of Monday being the first day of the week.