I Need to add approver group name and approval group members names in the notification body

Raju kunde
Tera Contributor

Hi Team,

 

Need to add approver group name and approval group members names in the notification body this notifications are configured on RITM, Change and knowledge tables.

Team please help on this task to add approver group name and approval group members names in the notification body.

 

Thanks in advance.

5 REPLIES 5

Aman Kumar S
Kilo Patron

Hey,

How are you triggering the notification?

If its general notification, try writing a Notification email script, and add that to the notification that is going out.

You can fetch the details from the "sysapproval_approver" table in the email script and embed the email script in your email notification.

 

Few reference articles:

https://developer.servicenow.com/dev.do#!/learn/learning-plans/quebec/new_to_servicenow/app_store_learnv2_automatingapps_quebec_notification_email_scripts

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/script/server-scripting/concept/c_ScriptingForEmailNotifications.html

 

Best Regards
Aman Kumar

Hi Aman,

 

Thank you for response,

 

i tried below script but i am not getting approver group name and approval group members names

 

var gr = new GlideRecord("sysapproval_approver");
gr.addQuery("sysapproval",current.sys_id);
gr.query();if(gr.next()) {
  template.print(gr.approver.getDisplayValue());}

and 

${mail_script:your_script_name}

 

help me on this script.

 

 

Can you check, how these notifications are triggered?

Also, use preview notification to see, how does it look there?

var grApprover = new GlideRecord("sysapproval_approver");
grApprover.addQuery("sysapproval",current.getUniqueValue());
grApprover.query();
if(grApprover.next()) {
  template.print(grApprover.getDisplayValue("approver"));
}

 

Best Regards
Aman Kumar

Raju kunde
Tera Contributor

Hi Aman,

 

we need approver group name and approval group members names, how can i get by using above.

help me on this.

 

Thanks.