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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2015 05:17 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2015 09:46 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2015 10:10 AM