- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:39 AM
Hi all, how to run a scheduled job every 'month' second 'week' 'monday'.
can someone suggest the conditional script for this. Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:56 AM - edited 08-01-2024 08:17 AM
-
Navigate to the Scheduled Jobs Module:
- Go to System Definition > Scheduled Jobs.
-
Create a New Scheduled Job:
- Click on the New button to create a new scheduled job.
-
Configure the Job:
- Name: Give your job a meaningful name.
- Run: Select Weekly from the dropdown. Set Monday in day
- Time: Set the specific time you want the job to run.
- Day of Month: Since you want the job to run on the Monday of the second week of the month, you'll need to use a script to handle this.
Here is the script
var now = new GlideDateTime();
var dayOfMonth = now.getDayOfMonthLocalTime();
var dayOfWeek = now.getDayOfWeekLocalTime(); // 1=Monday, 2=Tuesday, ..., 7=Sunday
// Check if it's the second Monday of the month
if (dayOfWeek == 1 && dayOfMonth >= 8 && dayOfMonth <= 14) {
// Your job logic here
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:48 AM
@SAM321 Please check below threads
Hope it helps.
Please mark my response as helpful/accepted if it helps.
Regards,
Priyanka Salunke

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:56 AM - edited 08-01-2024 08:17 AM
-
Navigate to the Scheduled Jobs Module:
- Go to System Definition > Scheduled Jobs.
-
Create a New Scheduled Job:
- Click on the New button to create a new scheduled job.
-
Configure the Job:
- Name: Give your job a meaningful name.
- Run: Select Weekly from the dropdown. Set Monday in day
- Time: Set the specific time you want the job to run.
- Day of Month: Since you want the job to run on the Monday of the second week of the month, you'll need to use a script to handle this.
Here is the script
var now = new GlideDateTime();
var dayOfMonth = now.getDayOfMonthLocalTime();
var dayOfWeek = now.getDayOfWeekLocalTime(); // 1=Monday, 2=Tuesday, ..., 7=Sunday
// Check if it's the second Monday of the month
if (dayOfWeek == 1 && dayOfMonth >= 8 && dayOfMonth <= 14) {
// Your job logic here
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 08:10 AM
Hi @Sandeep Rajput please look at the screenshot attached, will it works?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 08:16 AM - edited 08-01-2024 08:18 AM
@SAM321 Change the Run from Monthly to Weekly and select the Day as Monday. Rest looks fine.