UI Action - trigger email

AlexR
Tera Contributor

Hi,

 

I've a simple process required to send an email of an incident using a UI action. I've setup an event in the registry, email notification and the UI action, however the event doesn't trigger when clicking the action:

 

AlexR_0-1666174801043.png

 

AlexR_1-1666174861419.png

 

AlexR_2-1666174921747.png

 

can anyone advise on what's wrong. Many thanks

 

Alex.

2 ACCEPTED SOLUTIONS

Sagar Pagar
Tera Patron

Hi,


Try this below sample scripts and modify it accordingly.


if(typeof window == 'undefined')
fireEvents();

//Server-side function
function fireEvents(){
//Check even name properly:
gs.eventQueue("event.name", current);
action.setRedirectURL(current);
}

 

Note - Make sure that Send to event crater check box should selected.

 

Thanks,

Sagar Pagar

The world works with ServiceNow

View solution in original post

scott barnard1
Kilo Sage

Hi AlexR

in your UI action enclose your event push into a function.

(function() {

your code

 

})();

View solution in original post

3 REPLIES 3

Sagar Pagar
Tera Patron

Hi,


Try this below sample scripts and modify it accordingly.


if(typeof window == 'undefined')
fireEvents();

//Server-side function
function fireEvents(){
//Check even name properly:
gs.eventQueue("event.name", current);
action.setRedirectURL(current);
}

 

Note - Make sure that Send to event crater check box should selected.

 

Thanks,

Sagar Pagar

The world works with ServiceNow

scott barnard1
Kilo Sage

Hi AlexR

in your UI action enclose your event push into a function.

(function() {

your code

 

})();

AlexR
Tera Contributor

thank you both!, both solutions resolved this