How to run a Scheduled Job "daily" but exclude weekends

carlav
Kilo Guru

I need to create Scheduled Jobs following a script we created that initiates a Catalog Item, and the Scheduled Job needs to run daily and exclude weekends but I don't see how to select Daily excluding weekends. Any suggestions/direction would be appreciated!

find_real_file.png

1 ACCEPTED SOLUTION

Pranesh072
Mega Sage
Mega Sage

Check the conditional field and add following script

 

 

var result = true;

var gdt = new GlideDateTime();

var day  = gdt.getDayOfWeekLocalTime(); //The day of week value from 1 to 7. Monday equals 1, Sunday equals 7.

if(day==6||day==7)

result =false;

result ;​

 

View solution in original post

6 REPLIES 6

Sutapa Mukherje
Kilo Contributor

Hope this link will help you-

 

https://community.servicenow.com/community?id=community_question&sys_id=9201808fdb94d34c0e58fb651f9619be

 

Please mark as helpful..if it helps you 🙂

Vishal Savajia1
Kilo Sage

find_real_file.png