How to post KB article in more than one category?

mv
Tera Contributor

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. 

 

 

2 REPLIES 2

Eswar Chappa
Mega Sage
Mega Sage

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.

 

https://www.servicenow.com/community/now-platform-forum/can-knowledge-base-articles-be-assigned-to-m...

 

https://www.servicenow.com/community/now-platform-forum/can-you-post-your-kb-article-in-more-than-on...

 

https://www.servicenow.com/community/developer-forum/can-you-assign-more-than-one-category-to-an-art...

 

Thanks & Regards,

Eswar Chappa

Mark my answer correct and Helpful if this helps you 😀

Revanth Karra
Tera Expert

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:

  1. Create a new related list on the KB Article form.
  2. Select the KB Category table as the related table.
  3. Configure the related list to display the Name field of the KB Category record.
  4. 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:

  1. Create a new custom HTML widget.
  2. 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.

  1. 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