- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2018 02:09 PM
So this is a problem I'm dead certain someone else has had to tackle and answer. I'm importing and converting a very well-written and maintained knowledgebase. Images, videos, all of that is tackled, but what I can't seem to puzzle out is links between KB articles.
There are a lot of them, and the problem isn't as straightforward as it might at first appear. The way I see it, I've got two hurdles I need to overcome: Versioning and Service Portal.
Versioning, by itself, is not insurmountable. The system itself provides a way, here: links that use the KB number.
https://<instance>.service-now.com/kb_view.do?sysparm_article=KB0000030
Which, awesome, this will always link to the latest version of the article. But when you throw Service Portal into the mix, it falls apart for a few reasons:
- Service Portal recognizes https://<instance>.service-now.com/sp/kb_view.do?sysparm_article=KB0000030 well enough, but it does so by stripping out the /sp/ and loading the kb article in the default ITIL view. This won't work for us; we need to preserve the SP branding and nagivation bars.
- No matter how an article is called, the url displayed is always in this format: service-now.com/sp?id=kb_article&sys_id=d15de43187032100deddb882a2e3ec7d
This makes linking the latest article from a web browser just about impossible. - The links in the article itself won't work properly. Instead of sending the user to the Service Portal view of the article, the link will send them to the unadulterated (no navigation menus or other kibble) link in the full application view. This is undersable because we don't want end users in the itil view at all, and if they somehow get there showing them zero context is jarring and unhelpful at best.
- If I were to include all of these links, somehow, in a way that worked for Service Portal, now I have the issue where I'm breaking the ITIL users if they try to browse articles and forcing them out into Service Portal. This is also less than ideal.
So, to recap:
Currently, the kb_view.do? method of linking articles works to counteract the versioning problem. But Service Portal vs ITIL is still an issue that I don't see an easy way around. So my question is this:
- Is there a way to configure kb_view.do or create my own custom linking mechanism?
- If I do so, does anyone have a recommendation on programming it to detect if the user is on SP/Full view?
Thanks in advance for any help or suggestions you might have.
UPDATE: Having unsucessfully tried modifying the UI page and creating a processor to intercept the kb_view references, I'm starting to think that I need to disable the html sanitizer on the knowledge text view and use a javascript onclick for routing... It's either that or own both the SP widget and the UI Page for displaying knowledge articles. I hate to mess with the sanitizer, but my options are looking a little thin at the moment.
Solved! Go to Solution.
- 15,450 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2019 08:56 AM
Since this has become something of a hub for this conversation:
As far as I know, there's still no good answer for this problem. Owning the KB view widget partially solves the problem, but there are other widgets that start to have issues (like kb_header) and long term it feels like I'm going to own more and more of this page if I want everything to work right.
Realistically, everything I do is a band-aid, since we don't have good visibility on some of the versioning code to fix the problem at the source. If/when SN comes out with a better solution, I'll circle back and update this answer, but right now check the comments for several potential workarounds for this problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 03:05 PM
Hi,
I'm also struggling with this - we use both the /sp and /hrportal and these do not work, i can't show anything but the backend version of the knowledge article using the url below:
https://<instance>.service-now.com/kb_view.do?sysparm_article=KBXXXXX
I have tried a number of iterations but they all show as error 404 or 'article not found'.
Anyone solved this on the portals?
Thanks
Carl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2018 04:44 PM
Hi Carl,
I ended up going with an iffy solution that involved a fair bit of work to get going. In the end, how you proceed is going to depend on how important it is to your end users to be able to view past article versions. If it isn't, here's what I would do:
- Clone the existing knowledge content widget (I believe it's kb-article-content). From here you can either manipulate the date being fed in populateParameters() or point it at a new function in KBViewModel.
- In the populateParameters or the new function, Run two queries: one to get the article passed by sys_id, and a second to get the latest version of that article.
- Feed that article back the same way that KBViewModel is intended to work.
This might require some trial and error to make sure you're covering all of the URL types that you might see, particularly in articles that link to other articles. What we ended up doing was slightly more complex and involved making the page handle both sys_id and KB number, since that was an additional requirement, but if you don't have to do that there's no reason to complicate matters.
Let me know if that's confusing and I'll try to clarify with some examples.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2018 12:49 PM
Thanks for taking the time to explain how I can go about changing this, I will look into this further and see if I can get this working.
Cheers
Carl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2018 04:46 PM
We ended up overriding the default behavior in the knowledge content widget to check for the latest version before it retrieved the full KBViewModel widget.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2018 09:32 PM
Hi Beth
Can you please demonstrate the script you used in your knowledge content widget to query for the latest version?
Nat