How can KB articles be automatically linked to a Taxonomy Topic

rcook
Tera Expert

On a Taxonomy Topic there is a UI action to "Add content from a knowledge category". This appears to just be a point in time action and does not link newly created KB's in the Knowledge Category to the KB Topic.

On a KB article you can add the Taxonomy Topic to the form, but it is read only.

What is the intended method to have new knowledge articles automatically link to a Taxonomy Topic based on the Knowledge Category?

13 REPLIES 13

I agree. I also mentioned it's a solution, not the perfect solution.

But at this client, people complained that they needed to scroll all the way down the page to access the related list, so that's why we went with the list field on top of the page.

 

 

Ilaria Vilella
Tera Contributor

Hi, 

 

out team just found an easy workaround: we added a Run Script activity to the Knowledge - Instant Publish workflow related to the Knowledge:


var gr = new GlideRecord('m2m_connected_content');
gr.initialize();
gr.topic = 'add the topic sysID';
gr.content_type = 'add the content type sysID';
gr.knowledge = current.getUniqueValue();

gr.insert();

Ankit Kumar3
ServiceNow Employee
ServiceNow Employee

Hi @rcook , 

You can create a BR on KB creation and map a new KB created association in m2m_connected_content table with the required topic.

pritikaS
Tera Contributor

You can use OOTB API and try to automate it Via Schedule Job, below is the code API detail.

This API will add content to connected content table.

var uncontent = new GlideRecord('unconnected_category_content');
uncontent.addEncodedQuery('topic={your category Id}');
uncontent.query();

while(uncontent.next()){
new global.TopicCategoryUtil().moveNewCategoryContentToConnectedContent(uncontent);
}