How to update content of multiple knowledge articles simultaneoulsy?

VinayKanth
Tera Contributor

We need to update the content of multiple KB articles within a Knowledge Base. The content is basically the Escalation group name or a URL  (Inside the description of the article).

How to do a mass update on multiple articles simultaneously without altering the other content?

Eg: 25 articles have to be updated with new Escalation group name within the content.

1 ACCEPTED SOLUTION

kenv
Kilo Expert
A find and replace by knowledge base is definitely needed. We have been asking for this for many years. This is the same use case we run into frequently as teams are rebranded. We shouldn't have to rely on a ServiceNow admin to create a script for this. The KM team should be able to find and replace these names and urls or any specific text when needed in a knowledge base.

View solution in original post

5 REPLIES 5

Prashant16
Kilo Guru

Hi Vinay,

You can use a fix script for this. you can first filter the list of the article which you need to update and paste the encoded query in the below code:

 

var kbRecords = new GlideRecord('kb_knowledge');
kbRecords.addEncodedQuery('workflow_state=published^sys_class_name!=kb_knowledge_block^kb_knowledge_base=a7e8a78bff0221009b20ffffffffff17');
kbRecords.query();
while (kbRecords.next()) {

kbRecords.group_name = 'a7avsgv2'; // put sys_id of the group
kbRecords.autoSysFields(false);
kbRecords.setWorkflow(false);
kbRecords.update();
}

 

Please mark my answer Correct & helpful if resolves your issue.

Thanks,

Prashant

kenv
Kilo Expert
A find and replace by knowledge base is definitely needed. We have been asking for this for many years. This is the same use case we run into frequently as teams are rebranded. We shouldn't have to rely on a ServiceNow admin to create a script for this. The KM team should be able to find and replace these names and urls or any specific text when needed in a knowledge base.

VinayKanth
Tera Contributor

Do we have any option or script that is currenlty available to replace the content next to specific Word. 

Eg : In Knowledge article it shows Resolver Group : A/B/C/D but I need to replace all this with Resolver Group E How do we do this? 

Julia Lee
Tera Contributor

In the future, you could use knowledge content blocks to contain that type of information. Then you only have to update the Knowledge block. 

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/product/knowledge-management/conc...