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

How to send notification if state is Pending for more than 3 days

Rameshnathan
Tera Expert

Hi,

Scenario 1

If Ticket status is On Hold state more than 3 days means we need to send 1st notification to user

Scenario 2

If the same ticket status is On Hold state more than 6 days means we need to send 2nd notification to group

The notification days will be change based on the customer so that we are referring customer and days from another table

Ex : ABC customer 1st Notification Day 3 and 2nd Notification Day 6

Ex : XZY customer 1st Notification Day 4 and 2nd Notification Day 5

Please help me how to achieve this

Thanks

14 REPLIES 14

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Hi Ramesh,



I would say it depends. If it's find that all email is sent like once a day. Do a scheduled job. If you want a email to send when the 3 days has passed, use a workflow. Good example is the SLA workflow which sends notifications.


P_Dinesh kumar1
Tera Contributor

Hi Rameshnathan,

How you achieved this  functionality? Please share.

Hi P.Dinesh kumar , you can write a business rule like the below to schedule an event after the state changes to Pending lets say :find_real_file.png

 

find_real_file.png

 

 

gdt.addDayUTC(3); is adding 3 days ,

gs.eventQyueueScheduled() , is scheduling the event after 3 days to send the notification.

After it just register the event in Event Registry ,

Make a new Notification to run when the event fires and do the needed in notification.

 

Please Mark helpful if it resolves what you needed.

 

 

Thanks,

Adarsh Bhargav

Hii Adsrsh,

I want to know one thing if once the on hold condition meet then it will schedule the event to fire in ready state but if I change the state from 'On Hold' before scheduled date The event is not get canceled automatically it will send notification. What can I do If I don't want to send the notification in this case.   

Hi Paritosh ,

i hope you are doing well , For this also you can write a business rules as below which will automatically delete the events if the state has been changed from desired !!

 

find_real_file.png

 

find_real_file.png

 

 

in the above screenshot , i have created the BR on alm_hardware table , you can create on any table and mention it here in the code,

This BR will simply delete the events if the state has been changed before the event when it should be fired,

 

I hope i make it clear to you,Please mark it helpful if you find so!!