- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 02:15 AM
Hi All,
If an Agent wants to add an KB article as a comment to an Incident, he can use the attach button at the "related (contextual) search results" section.
The "Attach" button creates a comment like this:
[code]<a title='Are Copyrighted Files Illegal to Have On My
Computer?' href='kb_view.do?sys_kb_id=1addc9f1474321009db4b5b08b9a7120' >KB0000009 : Are Copyrighted Files Illegal to Have On MyComputer?</a>[/code]
The url leads to the plain article without the frames.
I need to edit it to include the instance name like below:
https://<Instance Name>.service-now.com/nav_to.do?uri=/kb_view.do%3Fsys_kb_id%3D1addc9f1474321009db4b5b08b9a7120
Please assist.
Thanks,
Sarah
Solved! Go to Solution.
- 3,558 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 03:46 AM
HI Sarah,
There are two ways to achieve it but both comes with pros and cons.
1) Write a before update BR which check for the content going in the additional comments and modify it as per your need.
You can apply checks like the value contains kb_view.do and then make changes in the value before it gets saved.
This is a short and precise method which can act as a workaround.
2) The second one is that you update the OOB script include (cxs_Knowledge) which creates this link.
You need to add the nav_to.do?uri= which will give your desired outcome.
Although to achieve this, you will have to remove the protection policy of the script include as its set to read-only and it won't let you edit anything.
Please run the below script in the background.
var gr = new GlideRecord("sys_metadata");
gr.get("42ec6aa0ef62210066fc36caa5c0fbce"); // update the sys_id of script include cxs_Knowledge.
gs.print(gr.sys_policy);
gr.sys_policy="";
gs.print(gr.sys_policy);
gr.update();
Disclaimer: This feature will come at expense of updating the OOB script include which will prevent it to get future updates, hence use if carefully if you want to manage the upgrades manually.
Thanks
Gaurav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 07:28 AM
Thanks for the comment! I'm glad I was able to help.