How i need to process the object sending through eventQueue to use its values in notification body?

Manikantahere
Tera Contributor

I need to send incident number, short description, and state value as object through event queue but i need to use these values inside the notification body at different places.

 

How can i do?

var inc = new GlideRecord("incident");
inc.addQuery("number","INC0010140");
inc.query();
if(inc.next()){
gs.print("Hello");

var abc = {};

abc.number = inc.number;
abc.short_description = inc.short_description;

gs.eventQueue('sendIncidentDetails',inc, JSON.stringify(abc));

}
 
 
Email Script:
 
var incObject = event.parm1;

    var incData = JSON.parse(incObject);

    template.variable1 = incData.number;
    template.variable2 = incData.short_description;
 Its not working??
1 ACCEPTED SOLUTION

you can do that by creating multiple email script call them at different part of the email body

 

Regards,
Chaitanya

View solution in original post

7 REPLIES 7

you can store them values as object and pass them to the event params you can parse that object in the email script and use the template object to print them in the notification and you can call that email script in the notification

 

ChaitanyaILCR_4-1732642596729.pngChaitanyaILCR_5-1732642616956.pngChaitanyaILCR_6-1732642626498.png

ChaitanyaILCR_7-1732642633813.png

Hope this helps

Regards,
Chaitanya

  • Thanks for your inputs however what i am looking for is i don't want to call email script all together but want to use variables defined in email script in notification body.

Is there any anyway that we can do it?

 

What you did is you are printing them both at a time but  i want to use them in different parts of email body.

you can do that by creating multiple email script call them at different part of the email body

 

Regards,
Chaitanya