Knowledge Article - How to add relative link (url) to another KB article

Gavin Jolly2
Tera Contributor

How can I add a link to another KB article which is relative, and will stay in the same portal. I need it relative to work between instances after migration or cloning. This area seems relatively weak compared to other CMS's where there is often a token with a relative link to another article as in Silverstripe, Markdown and other solutions

 

Two types of URL  in ServiceNow - Permalink or ID based

 

When editing content, it looks like users need to put the URL in as  
/[portal]?id=kb_article_view&sys_parm_name=KB0011652 which means the article link will only work in one portal

GavinJolly2_0-1665624064380.png

 

 

 

 

 

 

 

5 REPLIES 5

Maik Skoddow
Tera Patron
Tera Patron

I think that's the reason why OOTB there is also a Knowledge Portal /kb available. If you point all manually edited URLs to that portal, it works for all linking portals.

Another approach is to create a display Business Rule which parses the knowledge article body for any introduced placeholders like {portal_id} and replaces it with the current portal.

 

Maik

While a technically valid suggestion it is not a realistic one. We are using the new and wonderful Employee Centre to provide a user focussed information solution. ServiceNow is pushing Employee Centre this as the way forward and all solutions should be supported in that, and that alone.

 

All other CMS solutions have a feature, just like how Knowledge Blocks are replaced in KB Articles, to generate the link to other content at the page compilation time. 

I had to pick this up again and note there is already a precedent in here with the Knowledge Blocks. At time of page compile the Block DIV is replaced. All I am asking for is something similar for articles.

 

GavinJolly2_0-1666317326657.png

 

<h1>Header</h1>
<p>Body</p>
<p>Hey, look at this <a href="/ukp?id=kb_article_view&amp;sys_parm_name=KB0022333" target="_blank" rel="noopener" title="article KB0022333">article KB0022333</a></p>
<p></p>
<div id="kbblock_KBB0010030_1666317192591_kbblock" class="kb-block-content-item mceNonEditable" style="border: 1px solid #ddd; padding: 10px; margin: 5px 0; disabled: true; display: block; color: #343d47; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; line-height: 1.42857; font-weight: bold; width: 95%;">
<div class="block-info" style="display: inline-block; vertical-align: top;">KBB0010030<span class="block-info" style="display: block; margin-top: 3px;">Help us improve your BCAP experience</span></div>
</div>
<p>&nbsp;</p>

 

cecil m
ServiceNow Employee
ServiceNow Employee

You don't need to include the portal suffix in the URL.  

So instead of linking to

  • https://[instance-name].service-now.com/[portal]?id=kb_article_view&sys_parm_name=KB0011652OR
  • /[portal]?id=kb_article_view&sys_parm_name=KB0011652

You can link to 

  • ?id=kb_article_view&sys_parm_name=KB0011652

 

See also:

Solved: Linking to a KB article from within another KB art... - ServiceNow Community