How to get requested item number & cat_item in notification (notification is on Request table)

Chadaram Lokesh
Tera Contributor

Need to get the requested item & catalog item name in notification body & subject. This notification is taken on request table. 

find_real_file.png

help me the way to fulfill this.

Thank you.

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi,

Since notification is on request table you need a mail script. Try something as below.

System Notification >> Email >> Notification Mail script.

Create New: getritmdetails

with script as below

(function runMailScript(current, template, email, email_action, event) {

    var getritm = new GlideRecord('sc_req_item');
    getritm.addQuery('request', current.sys_id);
    getritm.query();
    if (getritm.next()) {
        template.print('Requested Item: ' + getritm.number);
        template.print('Catalog Item: ' + getritm.cat_item.getDisplayValue());
    }

})(current, template, email, email_action, event);

 

Call mail script in notification body field as below

${mail_script:getritmdetails}

View solution in original post

6 REPLIES 6

Hi @Murthy Chintalapudi 

Thanks for the reply. It is helpful

Community Alums
Not applicable

Hi @Chadaram Lokesh ,

Requested Item ${sysapproval} Approval Request for ${sysapproval.cat_item.name}

Item is the display value, cat_item is the name of the field. I think it should work.

Also,

find_real_file.png

 

Subject after preview:

 

find_real_file.png

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep