How to notify affected ci owners with their own information in change request?

crhistopherjuar
Kilo Expert

Hi!

What I am trying to do is to send an email notification to the ci owners when change request is in assess state.

I did this Business Rule.

Condition:   current.state.changesTo(-4) // -4 is Assess State

Script:

var owners = '';

var ci = new GlideRecord('task_ci');

ci.addQuery('task',current.sys_id);

ci.query();

while(ci.next())

{

owners += ',' + ci.ci_item.owned_by;

}

gs.eventQueue("change.ciowner", current, owners, gs.getUserName()); // Event name change.ciowner

Notification.

What will contain:

========================================================================

Dear Customer: ${user.company_name} // this company name have to be the affected ci company of the owner.

According to our records the affected CI will be: ${ci_item} // this have to be affected ci

====================================================================

The notification is general and all the affected ci owners recive the same notification.


The problem here is that we want to send these notifications very specific per customer, that just show their own company information, like the owner company name [user.company_name]   and the name of their affected ci.

My question is... Is there any way to send particular or specific notifications per affected ci owners?

8 REPLIES 8

Chuck Tomasi
Tera Patron

Hi Crhistopher,



You would need to generate a new event based on each type of notification you want to send.



If owner A gets notification A and owner B gets notification B and they are both part of the same change request, you need to fire different events to get the different notifications to go.



Events and Email Notification - ServiceNow Wiki


crhistopherjuar
Kilo Expert

Hi Chuck,



Could you give me an example for how could I build those events?
You would help me a lot with that.


Sure. Please provide some examples of what you had in mind for this statement:



Is there any way to send particular or specific notifications per affected ci owners?


How do you know who gets what notifications? Are they based on the CI class? Are they based on the CI Owner's department? What makes it different for user A to receive notification 1 and user B gets notification 2?


How do you know who gets what notifications?


I will know for the affected ci owners registered in the affected ci ´s related list.



Are they based on the CI class?


Yes they are.



Are they based on the CI Owner's department?



They are based on the Affected CI Owner Company.



What makes it different for user A to receive notification 1 and user B gets notification 2?


The Affected CI Owner Company