how to use gs.eventQueue() parameters in notification?

dev115415
Tera Expert

Hello

how to use gs.eventQueue() parameters in notification? I want to send an email and in email body I want to show that parameter. Like say for example I send the requester's full name. This I need to send from script include to email.

2 REPLIES 2

Devender Kumar
Tera Guru
Tera Guru

Hi @dev115415 ,

Please refer the below link.

https://www.servicenow.com/community/developer-forum/how-to-use-gs-eventqueue/m-p/2397295#:~:text=Us... 

 

You need to use GlideRecord for a table from which you want to fetch the requester's full name

Please refer below script.

 

/* Catalog Client Script: On Submit */

var sysIdRitm = g_form.getUniqueValue();

var ajx = new GlideAjax('updateRemoveUsersDevices');
ajx.addParam('sysparm_status', "status");
ajx.addParam('sysparm_sysId', sysIdRitm);
ajx.getXML(updateValues);
    function updateValues(response) {
        var answer = response.responseXML.documentElement.getAttribute("answer");
    }

/* Script Include: */

status: function (){
var sysId = this.getParameter('sysparm_sysId');

var ritmSysId = new GlideRecord('sc_req_item');
ritmSysId.getValue(sysId);
            
gs.info("Script Include - ritmSysId:" + ritmSysId);
                
gs.eventQueue('usr_updated',ritmSysId, ritmSysId.opened_by); // check field name for submitted by
}

 

and in the notification select Event parm 1 contains recipient

and 

Event parm 2 contains recipient
 

If my answer resolves your issue then please mark it as correct and helpful.

Regards,

Devender

My main objective is to know as to how to fetch the parameters in the message body of the email notification. Like I saw somewhere they use ${event.....} thing.