How to setup a notification for the Task Assigned To from a change on the Request?

Luke Dibben1
Kilo Contributor

Hi all,

How would I set up the Service Catalog such that when a user adds a comment to Additional Comments (On the Request), an email notification is sent to the Assigned To (On the Task)?

Regards,

Luke

16 REPLIES 16

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Luke,



You can achieve this req with help of events. Create a BR on request table which will be condition based i.e additional comment changes to trigger the event. In the script section you can GlideRecord "sc_task" table to fetch the assigned_to user and pass this as parameter in gs.eventQueue.


More info here.


The next step will be to create notification based on the event created.


Event Registry - ServiceNow Wiki


http://wiki.servicenow.com/index.php?title=Events_and_Email_Notification


For reference you can check a event and notification configured on Incident table.



Name is incident.commented.



Just have a look if any problem get back here will help you out


Hi Pradeep,


Could you help me with the GlideRecord aspect as I am unfamiliar with this.



Regards,



Luke


It will look like,



var notify = new GlideRecord('sc_task');


//add your query as per requirement


notify.query();


if(notify.hasNext())


{


if(//check if comments changes or not)


{


var gr = current.assigned_to;


}


}


gs.eventQueue('Event Name',current,gr);



//Note : this is just a guideline...not exact code...