How to trigger a notification to affected CI owners when the change request is approved

RamNarayana Sag
Kilo Contributor

How to trigger a notification to affected CI owners when the change request is approved?

Please help in how to create and event to trigger a notification to "Affected CI' owners.

2 REPLIES 2

manikorada
ServiceNow Employee
ServiceNow Employee

Sagar,



You can have a Business Rule which is triggered when the Change Request is approved.


The Business rule will get all the Affected CI Owners and send them a email.


Script would be:


Name: Trigger Notification


Condition: current.approval.changesTo('approved')


Script:


var owners = '';


var ci = new GlideRecord('task_ci');


ci.addQuery('task',current.sys_id);


ci.query();


while(ci.next())


{


owners += ',' + ci.ci_item.assigned_to;


}


gs.eventQueue("change.ciowner", current, owners, gs.getUserName());



Now have a notification corresponding to this event and have the 'Event parm 1 contains recipient' as true.



Wiki For Events and Notification : Events and Email Notification - ServiceNow Wiki


Bryan Campbell
Giga Expert

This is one of the few notifications we built directly into the workflow.



find_real_file.png