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

Chaitanya ILCR
Kilo Patron

Hi @Manikantahere ,
it should work
Have you fired the event ? or you are just previewing the notification?

Regards,
Chaitanya

I am getting nothing in notification.

is that correct way to use values in notification body.

 

notification body.png

if you have created notification email script call it in the notification with ${mail_script:Your_email_script_name}
you can directly call event.parm1,event.parm1 in the notification email script it will have access to event object


if you want to involve the event param value directly in the notification message use it like this
${event.parm1} ${event.parm2}

 

Regards,
Chaitanya

 

actually I have 3rd parameter to send but as I can't  send through event queue so want to store them inside object and sending it through event queue, want to processing them assigning to different variables to use them in notification body.