How to get Approver name in to knowledge notification?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2023 03:31 AM
Hi All,
Actually we have one knowledge reject notification on the knowledge table , i want to get the approver person name who is rejected the article in the knowledge notification, so for that i have created one email script it shows as "undefined'.
Email script;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2023 04:34 AM
Hi @Ramu6 ,
If the notification is already created on approval table then u don't need to write a email script for that. In the notification body itself u can select that field from the right hand side by expanding it. Please refer the screenshot attached.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2023 04:37 AM - edited 10-28-2023 04:37 AM
Hi @Ramu6 ,
On the other hand if u wish to go with email script try checking with below code
var approvedUser;
var approval = new GlideRecord("sysapproval_approver");
approval.addQuery("document_id",current.sys_id);
approval.addQuery("state","rejected");
approval.query();
if (approval.next()) {
approvedUser = approval.approver.getDisplayValue();
}
var emailContent = {};
emailContent.templateContent =
"<b>Author </b>: "+approvedUser+"<br/>" +
"<br/>" +
template.print(emailContent.templateContent);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2023 05:00 AM
Actually the notification was on the knowledge table , because of that i have written email script, i have tried above but still it prints "undefined"