- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2024 02:25 AM
I have a requirement to send notification to a group "HRSD EMEA" if case is still active based on opened time
Notification should trigger every first working day of alternate month starting April month. Means April, june, aug...and so on.
Can someone help with code.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2024 03:03 AM
Hi,
Please use this script in the condition of scheduled jobs.
var gdt = new GlideDateTime('2024-09-01 10:59:09');
var month = gdt.getMonthLocalTime();
var day = gdt.getDayOfMonthLocalTime();
var dayWeek = gdt.getDayOfWeekLocalTime();
if(month>4 && month%2==1 && dayWeek!=7 && dayWeek!=6){
return true;
}
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2024 02:31 AM
Hi @Hafsa1
For 2nd part:
For 1st part
Get all records, and see if ant case is active
Action
Send notification
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2024 03:03 AM
Hi,
Please use this script in the condition of scheduled jobs.
var gdt = new GlideDateTime('2024-09-01 10:59:09');
var month = gdt.getMonthLocalTime();
var day = gdt.getDayOfMonthLocalTime();
var dayWeek = gdt.getDayOfWeekLocalTime();
if(month>4 && month%2==1 && dayWeek!=7 && dayWeek!=6){
return true;
}
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2024 03:15 AM
Hi piyush,
field type is date only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2024 03:26 AM
No issues,
Use GlideDateTime in such situation only the time will be 00:00:00 . GlideDate give some error
Regards,
Piyush Sain