How to schedule reports to run during business hours only



How to Schedule a Report to only send out during Business Hours (Periodically)



1. Create a Schedule (System Scheduler > Schedules), or use an existing Schedule in your system
2. Add the 'Conditional' and 'Condition' fields to your Scheduled Reports form 
3. Check the 'Conditional' checkbox 
4. Set 'Run' to Periodically, then set an hour interval you wish to have the report sent out with 
5. In the 'Condition' field, use the following script (replace the timezone with your timezone, replace the 32-character sys_id with the sys_id of the Schedule you created - you can get that by right-clicking it in the Schedules list and selecting Copy sys_id 
var s = new GlideSchedule("08fcd0830a0a0b2600079f56b1adb9ae"); 
var gdt = new GlideDateTime(); 
s.isInSchedule(gdt, "US/Pacific"); 
*Note that the above sys_id is the sys_id for the OOB 8-5 weekdays Schedule. Also note that you need to change the Schedule Timezone if you are not using US/Pacific 

Applicable Versions

All Versions of Enterprise


Additional Information

See relevant Community article here.