- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 05:58 AM
Hi All,
Can someone please advise on the conditional code for running a scheduled job for every 3rd Thursday of the month?
I can find examples online but I am not sure what to change in the code to match my requirement.
Many thanks,
Alex
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 06:05 AM
Try the following:
var gdt = new GlideDateTime().getDate();
var day = gdt.getDayOfMonth();
var week = gdt.getDayOfWeek();
if(day == 4 && week == 3) {
//3rd thursday of month
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 03:42 AM
Hello again,
I would remove the script from the 'Run this script' section and test.
That's the only difference between my one and yours so hopefully works!
Thanks,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2021 01:56 PM
Tried removing script form 'Run this script" section still not working request is created daily.
SMH!!!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 06:54 AM
Did you ever find a solution to this? I am having a similar issue where I try to run it daily with a condition to check if the day is the 1st Tuesday of each month, yet the record is created daily.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 06:29 AM
It checks to see if it is a Thursday (new Date().getDay() == 4) and if it is greater than or equal to 14 days into the month and less than or equal to 21 days. That's where the 3rd Thursday falls in the month (new Date().getDate() >=14 && new Date().getDate() <=21).
if( (new Date().getDay() == 4) && (new Date().getDate() >=14 && new Date().getDate() <=21) )