Email Notification - How to add link to KB Question or Article

Floridalife
Giga Expert

When using this code to link the record ${URI_REF} for an email about question/answer or KB article, it links to the RAW record and not the KB interface the users are familiar with, how can we link it directly into the KB interface?

1 ACCEPTED SOLUTION

Got it working with changing to SYSID



<p>  <a title="View Question" href="/$social_qa.do?sysparm_view=question&amp;sysparm_question_id=${sys_id}" target="_blank">View Question</a></p>



Thanks for your help !


View solution in original post

5 REPLIES 5

dravvyramlochun
ServiceNow Employee
ServiceNow Employee

Hello Mathieu,



I did not test this but maybe you can create a client template and create a notification script :



var instanceName = 'instance.service-now.com'


template.print("<a href=\'" + instanceName + "nav_to.do?uri=kb_knowledge.do?sys_id=" + current.sys_id + "\'>"+current.number+"</a>");


and then in your notification you can invoke this script


Body: ${mail_script:knowledgeLink}


THanks Dravvy ill test, i read that SN express comes with default notification email for KB as shown here https://express.servicenow.com/support/documentation/knowledge-notifications-exp/



My Heinsiki instance didnt come with any . Is there a way to enable them?



Also Is there no default email for KB social questions/answer to template from? starting from scratch is very time consuming


I just loaded a DEV instance with the latest version and lucky me found some default notification, they are using the code below to link to the question in the email, i tried it in heinsiki but get this error pictured, any idea whats missing?


QNNCU4r.png



<p><a title="View Question" href="/$social_qa.do?sysparm_view=question&amp;sysparm_question_id=${question}" target="_blank">View Question</a></p>


Got it working with changing to SYSID



<p>  <a title="View Question" href="/$social_qa.do?sysparm_view=question&amp;sysparm_question_id=${sys_id}" target="_blank">View Question</a></p>



Thanks for your help !