The CreatorCon Call for Content is officially open! Get started here.

Schedule notification off business hours

Nisha B
Tera Expert

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.

1 ACCEPTED SOLUTION

Community Alums
Not applicable

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);

 

}

View solution in original post

3 REPLIES 3

Community Alums
Not applicable

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);

 

}

Ankur Bawiskar
Tera Patron
Tera Patron

@Nisha B 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Nisha B 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader