How to Notify Someone 1 Week Before End Date

msekla
Tera Contributor

Is there a way to send out an email notification to the "Requested By" person on the External Vendor Access request for like a week before the end date is due?  Just notifying that the access will be rescinded soon, giving the person a chance to change/extend the due date, if needed. A screenshot of the form I am talking about is attached.

32 REPLIES 32

AshishKM
Kilo Patron
Kilo Patron

Hi @msekla , 

Yes you can configure the timer and notification in workflow, timer will wait until due date based on end date and trigger the email notification.

You can configure event based notification or direct add that notification within the workflow.

 

-Thanks,
AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

msekla
Tera Contributor

@AshishKM Can you show me step by step of how would I do this because I tried it and it didn't work. Screenshot your final answer in order to attach it to your reply.

you can add the timer / notification within the workflow. 

 

AshishKMishra_0-1711049401436.png

 

Use the below code in timer for wait. here, end_date is catalog variable. 

 

AshishKMishra_1-1711049525322.png

 

 

 

 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Sumanth16
Kilo Patron

Hi @msekla ,

Here is the sample scheduled job script: (Which will send an email notification 6 days before the date.)

var ceTasks = new GlideRecord('sn_hr_core_task');//update your table name
ceTasks.addEncodedQuery('//add your query');
ceTasks.query();
while (ceTasks.next()) {
var getEffStrDate = ceTasks.work_start_date; //get the date of your selected field
var effStrDate = new GlideDateTime(getEffStrDate);
effStrDate.addDaysLocalTime(-7);
var getDaysDate = effStrDate.getLocalDate();
var toDateTime = new GlideDateTime();
var toDate = toDateTime.getDate();
var compareDateTime = getDaysDate.compareTo(toDate); //Comparing both dates
if (compareDateTime == 0) {
gs.eventQueue('sn_hr_core.decison_7_days_global', ceTasks, ceTasks.assigned_to);//configure the event and add the notification
}
}

 

 

Configure the event with the name sn_hr_core.decison_7_days_global and select your table in event.

Create notification and select Event is fired. 

Add required details from the event to the notification.

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hi @msekla 

I beleive this can be achieved without script.

There is "Wait Relative duration" action in flow designer which can be utilised for this requirement.

 

Kind Regards,

Ravi Chandra.