Update multiple articles by script

Daniel Vieira
Tera Expert

Hi everyone,

 

I need to update a large number of articles in ServiceNow. The goal is to keep each article as the previous one but with a new version. This is necessary because I have a Business Rule that should run upon update to make some adjustments to the articles.

 

Since this only needs to happen once, I was thinking of using a Scheduled Job. However, the script I’ve been using ends up creating a new article with the same number, but it doesn’t maintain the relationship with the previous version. What I actually want is to create a new version of the existing article and publish it—just like we can do manually through the UI.

 

Doing this manually is not ideal due to the volume of articles. Is there a script or method that can help me update all articles efficiently while preserving their version history and triggering the Business Rule?

 

Thanks in advance!

Daniel Vieira

6 REPLIES 6

@Daniel Vieira 

when you install the plugin there you get 2 script includes.

Check if any of that function can be used to create a new version.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Shashank_Jain
Kilo Sage

@Daniel Vieira ,

 

There is a system property  "glide.knowman.versioning.enabled" if we make this property true and update the existing article then it will create the new article with the updated version and the state will be draft of that newly created article.

 

Hope it helps somewhere!

If this works, please mark it as helpful/accepted — it keeps me motivated and helps others find solutions.
Shashank Jain