How to redirect KB article from notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 12:41 AM
HI,
I am trying to redirect the KB article from notification. How can i do that? I tried multiple ways but it is not redirecting.
Kindly help me please.
Notification is on Table : Knowledge Feedback
Article Number: ${article.number} // here it should redirect
Article Title: ${article.short_description}
Thanks,
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 12:53 AM
Hi Bala,
Try below code in mail script
var kbObj;
var knowledgeGR =new GlideRecord('kb_knowledge');
knowledgeGR.addQuery(‘sys_id’,current.article);
knowledgeGR.query();
if(knowledgeGR.next()){
kbObj = knowledgeGR;
}
//Article link
"<b>Article Number</b>: <a href='https://" + gs.getProperty('instance_name') + ".service-now.com/sp?id=kb_article_view&sys_kb_id=" + kbObj.sys_id + " '>" + kbObj.number + "</a><br/>"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 01:14 AM
Hi Bala,
you need to create Mail Script fro this as below
Create mail Script : knowledge_article_details
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var knowledgeGR = new GlideRecord('kb_knowledge');
knowledgeGR.addQuery('sys_id', current.article);
knowledgeGR.query();
if (knowledgeGR.next()) {
//Article Number link
template.print("<b>Article Number</b>: <a href='" + gs.getProperty('glide.servlet.uri') + "kb_view.do?sys_kb_id=" + knowledgeGR.sys_id + "'>"+knowledgeGR.number+"</a><br/>");
// Article Title
template.print("<b>Article Title:</b>:" + knowledgeGR.short_description + "<br/>");
}
})(current, template, email, email_action, event);
Call this script in Notification Body as below
${mail_script:knowledge_article_details}
Result :
Kindly mark helpful and correct if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 03:13 AM
Chethan,
I have written the notification on KB feedback table.
It is not working chethan. Could you please help me on this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 03:42 AM
Hi,
Have you tried using below line:
Article Number: ${article.URI_REF} // it will show Link with Display Value (i.e number)
Thanks,
Anil Lande
Thanks
Anil Lande