doubt with notification

suresh kaliappa
Tera Expert

Hello All , 

 

My requirement is in cmdb_rel_ci table if multiple child ci's was related to a single parent ci then the list of child ci's related to parent ci needs to be populated in 1 notification. Ex. let us consider parent A is the parent ci and Child CI A , B and C was child ci's related  to parent A. now in cmdb_rel_ci table it create 3 records with parent ci  , child ci and relationship type details. my task is to fetch all the child ci details in 1 notification and triggers only 1 notification to application support owner of the parent ci. So can someone please suggest how can this be achieved?

1 REPLY 1

-O-
Kilo Patron
Kilo Patron

You could use a Notification Email Script for this.

Let's say you define a Notification Email Script and name it u_print_ci_relationships then you can insert the token ${mail_script:u_print_ci_relationships} into the desired notification's HTML message and whatever your Notification Email Script "prints" will be included into the notification at that spot.

 

Notification Email Scripts print by calling

template.print('<html string>');

 

In that Notification Email Script you should look up the records, loop through those and print out each record perhaps as rows of an HTML table.

In the Notification Email Script you will be able to access data about the notification, like the record for which the Notification is emitted, the Notification definition, etc.

The default script for the Notification Email Script will enlighten you.