How to insert a hyperlink to a KB article in comments using a template?

JasonS_
Tera Contributor

How can I format url's in comments through applying a template that makes the url an active hyperlink?

I have tried simply including the full url and bracketing the url in [code][/code] but it applies as plain text. 

Examples: https://cardno.service-now.com/kb_view.do?sysparm_article=KB0010151
[code]https://cardno.service-now.com/kb_view.do?sysparm_article=KB0010151[/code]

 

Thank you,

Jason S.

1 ACCEPTED SOLUTION

JasonS_
Tera Contributor

Thank you - I will try that method also; however, I kept playing around with it and was able to get this to work also using the KB article permalink:

 

[code]<a href="https://cardno.service-now.com/kb_view.do?sysparm_article=KB0010151">How To Reset your Cardno Password</a><br />[/code]


I put the break tag in because I needed to go back to plain text after the link. When the comments are posted in the incident form, then it converts it to an active link.

 

Kind Regards!

Jason S.

View solution in original post

4 REPLIES 4

Anil Shewale
Mega Guru

Hi JasonS

Creating a link in an article

  1. Select the text to link.
  2. Click the Insert/Edit link icon on the Editing Toolbar.
  3. Paste the complete link in the URL box (including http:// or https://)
  4. Choose Target: New window (_blank)
    Insert/Modify link window; URL entered, Text field pre-populated with user's previously selected text, Target: New window (_blank) selected
  5. Click OK.

for more detail refer block for how to insert hyper link in kb artical.

https://it.umn.edu/servicenow-knowledge-create-link-in

 

If it help mark helpful or correct 

Thanks and regards

Anil

Swapnil Soni1
Giga Guru

Hi,

In client templates, you would create a Notification Email Script like:

Name: knowledgeLink

 

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 call it in your client template like:

 

Body: ${mail_script:knowledgeLink}

 

Please hit helpful or correct if this helps.

Thanks

Swapnil

Brian Bouchard
Mega Sage

Comments against knowledge articles are stored in a string field in the database, so you won't be able to render a clickable hyperlink in the comment field if KB Articles.


More specifically, they are stored in the comments field of the Knowledge Feedback table (kb_feedback)  If this field was an html field, you could do what I think you're asking, but it's not possible with a string field.

JasonS_
Tera Contributor

Thank you - I will try that method also; however, I kept playing around with it and was able to get this to work also using the KB article permalink:

 

[code]<a href="https://cardno.service-now.com/kb_view.do?sysparm_article=KB0010151">How To Reset your Cardno Password</a><br />[/code]


I put the break tag in because I needed to go back to plain text after the link. When the comments are posted in the incident form, then it converts it to an active link.

 

Kind Regards!

Jason S.