How to post KB article in more than one category?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 10:16 AM
I have a requirement to show one KB article, available in multiple Categories. Is there any OOB solution is available or custom solution for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 09:16 PM - edited 09-21-2023 09:16 PM
Hi @mv Unfortunately there is no possibility for linking an KB article for more than one category. Please find below community articles for your understanding.
Thanks & Regards,
Eswar Chappa
Mark my answer correct and Helpful if this helps you 😀
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 11:31 PM - edited 09-21-2023 11:33 PM
Dear mv,
@mv and @Eswar Chappa , hope you're doing great!
@Eswar Chappa Correct! There is no solution in ServiceNow to show one KB article in multiple categories.
But, Give a shot! There are a few custom methods that you can use.
CUSTOM METHOD 1:
Use a related list to display the KB article in multiple categories. To do this, follow these steps:
- Create a new related list on the KB Article form.
- Select the KB Category table as the related table.
- Configure the related list to display the Name field of the KB Category record.
- Add the related list to the KB Article form layout.
Now, when you view a KB Article record, you will see a list of all of the categories that the KB Article is associated with.
CUSTOM METHOD 2:
Use a custom HTML widget to display the KB article in multiple categories. To do this, follow these steps:
- Create a new custom HTML widget.
- Add the following code to the HTML field:
<script>
// Get the KB Article record.
var kbArticleRecord = GlideRecord('kb_knowledge');
kbArticleRecord.get('sys_id', 'sys_id_of_kb_article');
// Get the KB Category records.
var kbCategoryRecords = GlideRecord('kb_category');
kbCategoryRecords.addEncodedQuery('knowledge_base.sys_id=' + kbArticleRecord.getValue('knowledge_base') + '^kb_knowledge.sys_id=' + kbArticleRecord.getValue('sys_id'));
kbCategoryRecords.query();
// Display the KB Category names.
document.write('<ul>');
while (kbCategoryRecords.next()) {
document.write('<li>' + kbCategoryRecords.getValue('name') + '</li>');
}
document.write('</ul>');
</script>
Replace sys_id_of_kb_article with the sys_id of the KB Article that you want to display.
- Add the custom HTML widget to the KB Article form layout.
Now, when you view a KB Article record, you will see a list of all of the categories that the KB Article is associated with.
Kindly, please mark my solution as Helpful/Correct, if applicable. If I could help you with your Query then, please hit the Thumb Icon and mark as Correct!!!
Thanks & Regards,
Revanth. K
Product Test Automation Engineer