Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Email notification not triggered

abirakundu23
Giga Sage

Hi All / @Ankur Bawiskar / @Anil Lande ,

As per requirement have to send a mail simultaneously when inbound email action is triggered. Inbound email action triggered but event-based notification is not triggered.

//Inbound Email action on table "sys_email".

var h_profile = new GlideRecord('sn_hr_core_profile');
    h_profile.addQuery('personal_email', email.origemail);
    h_profile.query();
    if (h_profile.next()) {
       
        if(h_profile.u_contractual_country == "IN"){
            gs.info("Inside true condition");
            gs.eventQueue('event name', current, email.origemail, '' );
        }
    }

Notification:

akundu23_0-1703571172760.pngakundu23_1-1703571218300.png

 

This event-based notification is not triggered. We received log about "Inside true condition".
Could you please guide me ? 

 

2 ACCEPTED SOLUTIONS

var ga = new GlideRecord('sn_hr_core_case');
if(ga.get('<sys_id of your case record>'))//pass sys_id of your case
{
gs.eventQueue('sn_hr_core.cmt.case.respond', ga, 'xyz.com','xyz.com');
}

 

Also, please make sure that the email you are passing in param1 and 2 should be a valid email.

View solution in original post

@abirakundu23 

//var h_profile = new GlideRecord('sn_hr_core_profile');
    //h_profile.addQuery('personal_email', email.origemail);
    //h_profile.query();
    //if (h_profile.next()) {
       
        //if(h_profile.u_contractual_country == "IN"){
            //gs.info("Inside true condition");
            gs.eventQueue('event name', current, '<put valid email id here>','<put valid email id here>' );
        //}
    //}

 

Replace your inbound script with the above script and replace <put valid email id here> with a valid email id and check if it triggers the notification.

View solution in original post

28 REPLIES 28

var ga = new GlideRecord('sn_hr_core_case');
if(ga.get('<sys_id of your case record>'))//pass sys_id of your case
{
gs.eventQueue('sn_hr_core.cmt.case.respond', ga, 'xyz.com','xyz.com');
}

 

Also, please make sure that the email you are passing in param1 and 2 should be a valid email.

Hi Sandeep,

Description-; Notification not triggered in the emails.
Short Description;- I have created event in event registry business rules also created then call out the event to notification to trigger the notification for alm_license.LIST for renewal notification but email notification was not triggered.

 

 

abirakundu23
Giga Sage

Hi @Sandeep Rajput ,

For this requirement inbound action not create any HR case, we have aborted the case creation & the time send the notification through event that is our requirement. so what should i passed with get () method ?

@abirakundu23 For the testing purposes, simply pass the sys_id of any HR Case which exists in your sn_hr_core_case table. The intent of the running the background script is to check if the notification is triggering at all via the script or not.

abirakundu23
Giga Sage

Hi @Sandeep Rajput ,

Yes through fix script event fired & notification also triggered. Please guide me why not triggered after inbound email action triggered.