- 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
08-04-2022 10:04 AM
Just noticed my response must have gotten messed up during the migration from the old Wiki site years ago. The full "Condition" should be:
(new Date().getDay() == 1) && (new Date().getDate() <=7)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2022 10:09 AM
Hi jim,
my requirement is to scheduled it for last sunday of every month
can I use this
(new Date().getDay() == 7) && (new Date().getDate() >=25)
?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 06:08 AM
Scheduled Jobs.
There you can set the recurrence as you want it and put in the script that is to run on this schedule.
You can set it to run every month on day 1 at 6:00 am for example.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 06:29 AM
this is your function
2.49 isFirstDayOfWeek(Object)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2014 10:00 AM
In our condition field we use: (DayInWeekRule('Mon').equals('true') && DayInWeekInMonthRule('1').equals('true'));