- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2019 04:02 AM
Hi All,
I have a requirement for scheduled jobs to run on the on a certain day on certain months, for example -
Run on 1st of March, June, September and December.
Is there a conditional script to achieve this and to miss out weekends?
Many thanks,
Alex
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2019 08:47 AM
Set your scheduled job to run Monthly, on the date you need and time. Then in the condition script check for the month to trigger. Example below script triggers on 1 month, 4 month, etc
var result = false;
var gdt = new GlideDateTime();
if (gdt.getMonthLocalTime() == 1 || gdt.getMonthLocalTime() == 4 || gdt.getMonthLocalTime() == 7 || gdt.getMonthLocalTime() == 10) {
result = true;
}
result;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2019 01:42 AM
Hi!
I double checked with the team that requested this and skipping weekends was not actually required so I have used this script.
I will keep yours and test this as I'm sure someone will want to skip weekends.
Thank you!
Alex