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

How to send a notification only on Weekdays

SAS21
Tera Guru

 Existing logic - when the INC is in Pending state , a notification would trigger to the customer. From this first notification, we have to automate a follow-up notifications to users i.e. 3 follow-up notifications should be triggered Only on Business days (Week Days) .

(Email intervals-Every 2nd Business Day up to 3 notifications.)

How to implement this ?

Appreciate the Help!

Thank you

Bhavana

 

 

 

1 REPLY 1

Sandeep Rajput
Tera Patron
Tera Patron

@SAS21 You can trigger your notifications via a Scheduled Job, use following script in the condition fied.

 

(function isWeekday() {
   var isWeekday;
var gDate = new GlideDate(); //Uses your Timezone!
var day = gDate.getByFormat('EEEE'); //Gets name of day
switch(day) {
       case "Saturday":
       case "Sunday":
           isWeekday = false;
           break;
       default:
           isWeekday = true;
   }
return isWeekday;
})();

 

Source:https://docs.servicenow.com/bundle/vancouver-platform-administration/page/administer/time/reference/...

 

Hope this helps.