triger the event from the backgroud script for below given scenario and code

Kongaleti Navee
Tera Contributor

 

 I have a requirement that in a taxonomy table there are two fields product,product suite in which when new record is created and updated then you have to notify to a group(EmailGroupA) and its group members with number of  product and product suite created and updated .in the same way you have to notify to a group(EmailGroupB) and each of its group members with product and product suite name.How to achieve this in servicenow

 

for th above scenario i have created an event with this  "NotifyGroup.GR.Members".how to trigger the event from the backgroud script if the record is created or updated in the taxanomy table and notify to the EmailGroupA.Where should i gave the sys_id =5c97e7aa97173110c2f43fdce053afba of group and triger the event let me know.

 

var gr = new GlideRecord('u_taxanomy_table');
gr.addQuery();
gr.query();
if(gr.next()){
gs.eventQueue("NotifyGroup.GR.Members",current,param1,param2)

}

3 REPLIES 3

Musab Rasheed
Tera Sage
Tera Sage

Tai Vu
Kilo Patron
Kilo Patron

Hi @Kongaleti Navee 

If it's just normal database action in the table, you can configure directly in the Notification. It appears that there's no need to handle it through an Event in your case.

Timi_0-1703756163571.png

 

Cheers,

Tai Vu

Sandeep Rajput
Tera Patron
Tera Patron

@Kongaleti Navee Please create an onAfter Insert/Update business rule on Taxonomy table and add the script in the script field.