Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Schedule Report on 3rd working day of each month

Sravani39
Tera Contributor

Hi All,

Have a Requirement to Schedule a report on 3rd working day of each month.

Thanks

8 REPLIES 8

dmathur09
Kilo Sage

Hi Sravani,

You can change the Run field as Monthly and keep the Day as 3.

find_real_file.png

Regards,

Deepankar Mathur

Hi Deepankar,

Thanks for the reply. But 3rd day should be a weekday not weekend.

Please suggest what if 3rd day in a month is a weekend.

Thanks

Hi Sravani,

You can check the conditional checkbox as true and write the below mentioned script.

//Return 'true' to run the job
var answer = false;

//Get the day of week. 1=Monday, 7=Sunday
var now = new GlideDateTime();

//Run only on weekdays
if(now.getDayOfWeek() < 6){
   answer = true;
}
answer;

Regards,

Deepankar Mathur

Hi Sravani

Let me know in case of any queries.
If you think my response is helpful for you? If yes, mark it as correct answer and close the loop so that it would help future readers as well.

Regards,

Deepankar