How to make mass update in KB Article?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2019 07:58 AM
Hi,
We have a requirement regarding KB Article.
Need to replace an old URL to new URL. The old URL is present in the content of the article not in field.
Note :
There are 215 KB Articles are present. So we need to mass update all the articles.
Please provide me any suggestions or idea regarding this as soon as possible
Thanks
Lalitha
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2019 08:13 AM
Hello Lalitha,
You can use this article which provides steps to do bulk/mass updates on records: https://community.servicenow.com/community?id=community_blog&sys_id=60ccee25dbd0dbc01dcaf3231f961946.
Hit helpful or correct if it solves your issue.
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2019 08:29 AM
You can write fix script to mass update URL is content of KB article.
You will have to use regex to update URL in text of knowledge article.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2019 08:30 AM
Hi Lalitha,
The below script will find and update all of the articles with the correct URL:
var srcStr = oldURL; //Replace with url you want to replace
var fxdStr = newURL; //Replace with new url
var r = new GlideRecord('kb_knowledge');
r.addQuery('text','CONTAINS',srcStr);
r.query();
while(r.next()){
var txt = r.text.toString();
var fixed = txt.replace(srcStr,fxdStr);
r.text = fixed;
r.setWorkflow(false);
r.update();
}