Need to run a scheduled job on every 2nd Monday in every month.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2021 10:16 PM
Hello Developers!
I am trying to run a scheduled job for every 2nd Monday in every month.
Can anyone help me on that?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2021 10:21 PM
Hi,
you will have to make it trigger daily
then in the condition script check if it is 2nd Monday of month
refer these and enhance as per your requirement
job for Third Tuesday of each month
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2021 10:25 PM
Hi,
Steps
1) Conditional checkbox true
2) Condition script below
3) Daily
answer = checkCondition();
function checkCondition(){
var gdt = new GlideDateTime();
if((gdt.getDayOfMonthLocalTime() >= 8 && gdt.getDayOfMonthLocalTime() <= 14) && (gdt.getDayOfWeekLocalTime() == 1)) {
return true;
}
else{
return false;
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2021 10:33 PM
Hi,
I have template on sc_task table, need to generate that template on scheduled job on every 2nd monday.
Is that possible?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2021 10:53 PM
Hi,
you can create task based on template
How to apply a standard change task template via script / workflow
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader