Scheduled Job - First Saturday of each month

Chris Sutton
Tera Expert

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

 

1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

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);

 

find_real_file.png

 

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).

View solution in original post

3 REPLIES 3

Jim Coyne
Kilo Patron

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);

 

find_real_file.png

 

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).

Chris Sutton
Tera Expert

Awesome, thanks so much Jim! That makes sense 🙂

You are welcome!