Need to redirect into knowledge article.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Community,
In cmdb_ci table need to crate a xyz name link ( In related links) which redirect to specific knowledge article which is published in prod.
Please guide me how to create a related link (UI action) on cmdb_ci table in details.
Cheers,
Sandesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Sandesh,
Hope you are doing well.
Please try this one:
Solution:
You can achieve this by creating a UI Action on the 'cmdb_ci table and configuring it to appear as a Related Link.
Steps:
- Navigate to System Definition → UI Actions and create a new record
- Set the fields as:
- Table: cmdb_ci
- Check Form context menu (to show under Related Links)
- In the script section, use:
Script as :
action.setRedirectURL('/kb_view.do?sysparm_article=KB0012345');
Replace with your KB article number.
Alternatively, using sys_id:
Script as:
action.setRedirectURL('/kb_view.do?sys_id=YOUR_KB_SYS_ID');
- Save and test on any CI record.
Optional:
If you want dynamic behavior, create a reference field to kb_knowledge and use it in the script to redirect dynamically.
If each CI should open a different KB article:
Step 1: Add field to cmdb_ci
u_kb_article (Reference → kb_knowledge)
Step 2: Update Script
JavaScript
if (current.u_kb_article) {
action.setRedirectURL('/kb_view.do?sys_id=' + current.u_kb_article);
} else {
gs.addInfoMessage('No Knowledge Article linked to this CI');
}
Hope this helps! If it answers your question, please consider marking it as Helpful or accepting it as a solution.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Try this:
- Navigate to System Definition > UI Actions in your ServiceNow instance.
- Click New :
- Name: XYZ (or your desired display name)
- Table: Configuration Item [cmdb_ci]
- Active: Checked
- Form context menu : Checked
- Uncheck Client (this executes server-side).
- In the Condition field, you can restrict when the link is visible (like gs.hasRole("sn_cmdb_read")).
function redirectToKnowledge() {
var kbNumber = 'KB5234568'; //Replace your specific published Knowledge Article Number
var grKB = new GlideRecord('kb_knowledge');
grKB.addQuery('number', kbNumber);
grKB.addQuery('workflow_state', 'published');
grKB.query();
if (grKB.next()) {
var targetUrl = 'kb_view.do?sys_kb_id=' + grKB.sys_id;
action.setRedirectURL(targetUrl);
} else {
gs.addErrorMessage('The linked Knowledge Article could not be found or is not published.');
}
}
redirectToKnowledge();
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @SandeshR5514624 ,
1) click on form header > configure > UI action
2) create Ui action record
3) save and link visible on Form and test.
here i have created UI action on incident table you can follow this steps for cmdb_ci Table.
If this response was helpful, please consider marking it as Correct and Helpful. You may mark more than one reply as an accepted solution.
thanks ,
tejas😊