Event Triggered Email Notification Not Sending

alexkcha
Kilo Contributor

I have two web services used to create incidents.   Each service uses a web service transform map to call the same event in an onAfter script.   The event will cause an email notification to be sent.   I am running into an odd issue where the email notification is sent from one of the web services but not from the other.   I will try to describe my setup below:

Event

Name: incident.created.webservice

Table: Incident

Email Notification

Name: Incident Created Web Service

Event Name: incident.created.webservice

Sends When: Event is fired

Who Will Receive: Event parm 1 contains recipient

Web Service

Name: WsAlpha

Transform Map: WsAlphaTransformMap

WsAlphaTransformMap contains an onAfter script with the following:


gs.eventQueue('incident.created.webservice', target, group.sys_id, gs.getUserName());

Name: WsBeta

Transform Map: WsBetaTransformMap

WsBetaTransformMap contains an onAfter script with the following:


gs.eventQueue('incident.created.webservice', target, group.sys_id, gs.getUserName());


Scenario

When WsAlpha receives a request, an email notification is sent after the incident is created.   I can see in the logs where the event is called and triggers the email notification to be sent.  


When WsBeta receives a request, the event is called after the incident is created.   However, an email notification is never sent.   I don't see any warnings/errors in the system logs.   I have found that an email notification is sent after changing the 'parm 1' parameter from group.sys_id to group.email.  


gs.eventQueue('incident.created.webservice', target, group.email, gs.getUserName());


I am puzzled because the two web service transform scripts are calling the same event (also calling the same email notification as a result), but the results are different.   Any kind of assistance would be greatly appreciated.  

9 REPLIES 9

Hi Abhinay,
Event is triggering but notification is not triggering. But in preview notification i am not able to see email content. please find the below screen shot.



find_real_file.png


hi


I'm also facing the same problem. Did you find any solution ?



Thanks


Snehal


If the email address in parm1 is the same email address as the event creators, the notification will not send unless you select "send to event creator"



It's just ServiceNow's way of being a bit pedantic


Hi


I have "sent to event creator " is checked ,


thanks


Snehal


If you cannot see the notification in preview, then it should not be with the event creator property.Do you see anything in the logs, around the time notification was triggered?



Could you add some logs to your workflow/scripts (that triggers event).