notification with scripts

DoloLeNom
Tera Contributor

I have a task that consist  of :  

If an incident is opened more than 5 hours and no status change detected, a notification must be sent to the manager of the assigned to.

 

add a worknote to notify that the incident has been notified to the manager

 

Raise the priority of the incident

 

I want to know how to send notification with script for this exemple

 

1 ACCEPTED SOLUTION

Anil Nemmikanti
Giga Guru

Hi @DoloLeNom ,

 

1. create an Event in the event registry

2.Create A BR on insert in the BR use below code and add respective varaibles and processTime.

gs.eventQueueScheduled('sn_app.user.deactivate', now_GR, requestXML, gs.getUserID(), processTime);

3.Create a notification use the event and give additional condition state is New

4. In the notification mail script Glide the specific record and update the work notes.

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@DoloLeNom 

you can use flow and trigger when incident is created

Then use Wait for Duration flow logic and wait for 5 hours

After that check if the State is Still New

If yes then use "If Flow" logic and update the record and send email to manager

what did you start with and where are you stuck?

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

I have to do it with script I did not mention it but it is an exercice

Anil Nemmikanti
Giga Guru

Hi @DoloLeNom ,

 

1. create an Event in the event registry

2.Create A BR on insert in the BR use below code and add respective varaibles and processTime.

gs.eventQueueScheduled('sn_app.user.deactivate', now_GR, requestXML, gs.getUserID(), processTime);

3.Create a notification use the event and give additional condition state is New

4. In the notification mail script Glide the specific record and update the work notes.

Thank you for your help 🙏