i want to send to Notification when change is approved by MYIT Change Manager

anilkumarsharma
Giga Guru

HI Team,

Need   your help:

when I raise the change request which is going for myIT change manager approval group where I configured the 5 User.

Point1: I want to send the Notification ( Change Number CHG000123 is opened by and pending for your approval ).

Point2: when changed is approved by the any user from Group then Notification should be send ( Change is approved by the XYX ).

Pls. let me know who I can achieve.

4 REPLIES 4

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Hi,



Haven't thought to much about it, but a quick thought is that this should be pretty easy achieved through making normal notifications on the sysapproval_approver table with the conditions you want.or you build it in the workflow since you can send notifications through that as well.



//Göran


how i can send the notification without any script. Pls. suggest



On Thu, Jun 30, 2016 at 11:05 PM, goranlundqvist <


Abhinay Erra
Giga Sage

Anil,



  You will have to write an After Business rule on "change_request" table and trigger an event whenever a member of that group has rejected or approved the change. Here is how your script would look like


When: after insert and update


Condition: Approval changes and approval is rejected or approved


var gr= new GlideRecord('sysapproval_approver');


gr.addQuery('sysapproval',current.getValue('sys_id'));


gr.addQuery('state',current.approval);


gr.query();


while(gr.next()){


if(gs.getUser().getUserByID(gr.getValue('approver')).isMemberOf("put in your group name here")){


gs.eventQueue("......"); //log event here


}


}



Now you will have to create a new notification and trigger the notification when this event is fired.


Go thru this link


Events and Email Notification - ServiceNow Wiki


Let me know if need any help in coding


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee