- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2016 03:41 PM
Hello,
Looking for some guidance on how to do this. The goal is to send a different email notification to incidents created after hours. The notification will basically say we will review incident next business day. Hoping to get some help on scripting this.
I would probably need to create the following. Unless if can recommend other way of doing it. Best practice???
Event to trigger notification
Business Rule
Notificaition
Thank You,
Edwin
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 01:21 PM
You 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
10-03-2016 01:21 PM
You 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
10-03-2016 01:22 PM
I was thinking of adding this to the notification. But since its look like im not using the event, not sure what to put in the bold section. If i understood correctly...
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var sched = new GlideSchedule('f06c075e6fa60900b3a2f941be3ee4e9');
var d = new GlideDateTime(current.opened_at);
if (sched.isInSchedule(d)) {
gs.eventQueue('notification_engine.process',current,current.caller_id);
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 01:23 PM
OK..i'll try that today.
Many Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2016 12:29 PM
i have never tried this.. HOWEVER...
if the conidtion is based strictly on after hours.. I noticed in the condition builder.. there is a trend.. so you could concievably set the the condition builder to check for saturday, or sunday, or after 5 pm and before 8 am
might be worth testing to see if it works.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 01:25 PM
Let me how it goes. If it works, don't forget to update the thread by marking my response as correct