- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 10:08 PM
Hi Team,
How can I schedule a job to run only on the 2nd working day of the month? For example in the month of January of this year, 4th is the second working day, so job should run only on 4th. Only once in a month that too on a second business day.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2022 08:01 AM
Hi Khanna,
To exclude holiday, use Schedule.
- Create a new Schedule (from Navigator, go to System Scheduler > Schedules > Schedules)
I've create a schedule named "Weekdays excluding Holiday".
Add "U.S. Holidays" as a Child Schedule. - Create Schedule Entries to the schedule
- Set Condition on Scheduled Job
Run: Daily
Condition:function checkIfSecondDay() { var grSchedule = new GlideRecord('cmn_schedule'); if (grSchedule.get('name', 'Weekdays excluding Holiday')) { var sched = new GlideSchedule(grSchedule.sys_id); var gdt = new GlideDateTime(); gdt.setValue(gs.beginningOfThisMonth()); var days = 1; var dur = new GlideDuration(60 * 60 * 24 * 1000 * days); var secondDay = sched.add(gdt, dur); var today = new GlideDateTime(); today.setDisplayValue('2022-01-05 12:00:00'); return (today.getDayOfMonthLocalTime() == secondDay.getDayOfMonthLocalTime()); } return false; } checkIfSecondDay();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2022 04:23 AM
As per the screenshot. Job will run only once on 3rd day of the month. And if the script conditions are not matching when it ran then it will run next month. This doesn't work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2022 08:01 AM
Hi Khanna,
To exclude holiday, use Schedule.
- Create a new Schedule (from Navigator, go to System Scheduler > Schedules > Schedules)
I've create a schedule named "Weekdays excluding Holiday".
Add "U.S. Holidays" as a Child Schedule. - Create Schedule Entries to the schedule
- Set Condition on Scheduled Job
Run: Daily
Condition:function checkIfSecondDay() { var grSchedule = new GlideRecord('cmn_schedule'); if (grSchedule.get('name', 'Weekdays excluding Holiday')) { var sched = new GlideSchedule(grSchedule.sys_id); var gdt = new GlideDateTime(); gdt.setValue(gs.beginningOfThisMonth()); var days = 1; var dur = new GlideDuration(60 * 60 * 24 * 1000 * days); var secondDay = sched.add(gdt, dur); var today = new GlideDateTime(); today.setDisplayValue('2022-01-05 12:00:00'); return (today.getDayOfMonthLocalTime() == secondDay.getDayOfMonthLocalTime()); } return false; } checkIfSecondDay();