- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2016 01:52 AM
Hello folks,
I'm in a need to add Affected CIs list to the Change Approval notification that is currently running against sysapproval_approver table.
Using available Fields on the notification doesn't seem to fit any of the requirements and I need to include the list of the Affected CI only on the approval notification against sysapproval_approver table.
Can this be achieved in any way? I have no idea how to script it as I don't know Javascript.
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2016 03:49 AM
Changed current.sysapproval too ?
gr.addQuery('u_task', current.sysapproval);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2016 07:17 AM
Hi Thomas,
In the end, I had to use only Impacted Applications, as Affected CIs were not needed.
Here's the email script that worked for me:
var gr = new GlideRecord('u_m2m_tasks_cmdb_ci_appl'); // 'Impacted Bus Applications' related list table
gr.addQuery('u_task', current.sysapproval); // only affected ci's for the task that is being approved. "current" refers to the approval record triggering the notification
gr.query(); //execute the query
while (gr.hasNext()) { //check if the query returned any results
template.print('<br/><b>Impacted Bus Applications:</b>'); //print to the notification
while (gr.next()) { //loop through each of the returned records
template.print('<br/>' + gr.u_application.getDisplayValue()); //print the name of the CI
}
}