
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2021 05:03 PM
Hi all,
I currently have a requirement to create a scheduled job for a task to generate on the first Saturday of each month. I can't see any way to do this without scripting. I have come across Scheduled Job Condition - First Monday of Every Month but unsure how to edit this to change to Saturday and I'm not too sure I completely understand the scripting in the post to begin with (beginner at scripting). If anyone could assist, I would greatly appreciate it!
Thanks,
Chris
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2021 06:30 PM
You just need a little bit of scripting to get the current day of the month. Set your job to run on every Saturday, check the "Conditional" check box and use the following in the "Condition" field:
answer = (new GlideDateTime().getDayOfMonthLocalTime() <= 7);
So the job WILL be triggered every Saturday at whatever time you specify, BUT the condition will end the job if it is not in the first week of the month (within the first 7 days).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2021 06:30 PM
You just need a little bit of scripting to get the current day of the month. Set your job to run on every Saturday, check the "Conditional" check box and use the following in the "Condition" field:
answer = (new GlideDateTime().getDayOfMonthLocalTime() <= 7);
So the job WILL be triggered every Saturday at whatever time you specify, BUT the condition will end the job if it is not in the first week of the month (within the first 7 days).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2021 06:42 PM
Awesome, thanks so much Jim! That makes sense 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2021 08:22 PM
You are welcome!