Run a schedule job at 2 am from Monday to Friday and at 8 am on Weekends.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2024 08:35 PM
Hello!
I want to run a Scheduled Job at 2 am from Monday to Friday and run same Scheduled Job at 8 am on Saturday and Sunday. How can do this?
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2024 08:55 PM - edited ‎02-29-2024 08:59 PM
Hi @SNewbies
scheduled-send-only-on-monday-wednesday-friday-script
In Scheduled Jobs please enable the Condition checkbox and paste the below code.
var answer = false;
var now = new GlideDateTime();
if(now.getDayOfWeekUTC() !=6 && now.getDayOfWeekUTC() !=7 ) // this scheduled job will run only on Weekdays
{
answer = true;
}
and configure our condition here
Please mark reply as Helpful/Correct, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2024 08:59 PM - edited ‎02-29-2024 08:59 PM
Hello!
Thank you for your response.
I want to run the same scheduled job for weekends too but at different time.
It should run at 2 am on weekdays and at 8 am on weekends.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2024 09:05 PM
Hi @SNewbies this is not possible, since you need to define time in schedule job.
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2024 09:08 PM
Hi @SNewbies
I found one article regarding this requirement please follow this it willl be helpful to you
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0750527
Please mark reply as Helpful/Correct, if applicable. Thanks!