Schedule Job for Selected day of Selected Month

Community Alums
Not applicable

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

 

1 ACCEPTED SOLUTION

Michael Fry1
Kilo Patron

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

find_real_file.png

 

 

var result = false;
var gdt = new GlideDateTime();
if (gdt.getMonthLocalTime() == 1 || gdt.getMonthLocalTime() == 4 || gdt.getMonthLocalTime() == 7 || gdt.getMonthLocalTime() == 10) {
	result = true;
}
result;

View solution in original post

10 REPLIES 10

Community Alums
Not applicable

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