Approval table Notification adding request info on the body

Yasin Shaik11
Tera Contributor

Hi,

Need help on the below requirement 

 

I have created notification on sysapproval_approver table . The conditions are the 

Approval for. Task Type---> Is ----> Request Item 

I  the body of the notification i want to add the Request information that means  the approval is happen for that request 

I need to add that request information in the body  

Thanks in advance 🙂 

1 ACCEPTED SOLUTION

@Umar 

Glad to know that my script worked.

use template.print('<br/>') to print in new line

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

11 REPLIES 11

Hi,

if it didn't work then you can use email script and print it

then include that email script in email body

${mail_script:mailScriptName}

var gr = new GlideRecord("sc_req_item");
gr.addQuery("sys_id", current.sysapproval);
gr.query();
if (gr.next()) {
   template.print(gr.request.number);
}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

I called in the notification body but not getting output and for your kind information the same code i have tested in the backgroud script getting error like ---->

Cannot read property "sysapproval" from null
   Caused by error in script at line 2


Please help me on this.!

Thanks 🙂

Hi,

script will work if your notification is on sysapproval_approver table

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Good Morning.!

 

I have written on the sysapproval_approver for your reference please find the attachment 

Hi,

your question is for showing REQ number but you are doing preview of CHG record

Can you test it well?

share your email script as well

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader