- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 03:34 AM
Hello All,
I have requirement to trigger the notification only in off business hours whenever p1 incident is created between 7 pm CET to 6 am CET . then it should send the email notification.
Thanks and Regards.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 04:07 AM
Hi @Nisha B ,
ou will have to change this to send when an event is fired. Register a new event and change this notification to go out when that event is fired. In your existing business rule add an else condition
var sched = new GlideSchedule('sys_id of your schedule goes here');
var d = new GlideDateTime(current.opened_at);
if (sched.isInSchedule(d)) {
gs.eventQueue('event name',current,current.caller_id);
}
else{
gs.eventQueue('event name 1',current,current.caller_id);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 04:07 AM
Hi @Nisha B ,
ou will have to change this to send when an event is fired. Register a new event and change this notification to go out when that event is fired. In your existing business rule add an else condition
var sched = new GlideSchedule('sys_id of your schedule goes here');
var d = new GlideDateTime(current.opened_at);
if (sched.isInSchedule(d)) {
gs.eventQueue('event name',current,current.caller_id);
}
else{
gs.eventQueue('event name 1',current,current.caller_id);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 04:18 AM
you can use flow designer for this
OR
you can use eventQueueScheduled() function
The Power of System Events - Part 2 - gs.eventQueueScheduled
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 04:20 AM
Thank you for marking my response as helpful.
As per new community feature you can mark multiple responses as correct.
If my response helped please mark it correct so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader