How to make a business rule run retroactively?

Brandon8
Kilo Expert

I created a business rule to updated a created by username. It is very simple but only runs on update and created. Is there away to make it go back an update all cases? Thanks!

 

find_real_file.png

1 ACCEPTED SOLUTION

Brian Bouchard
Mega Sage

Hi Brandon - You can't run a business rule retroactively, but you could run either a scheduled job to determine which records need updating and then do the update, or you could run a fix script to do similar.

View solution in original post

8 REPLIES 8

TrevorK
Kilo Sage

Why not just put the code into a Background Script: https://docs.servicenow.com/bundle/london-application-development/page/script/server-scripting/concept/c_ScriptsBackground.html

This is what we do when we have the update historical data upon implementation of new logic / rules.

 

I would assume you could also change it to a "query" Business Rule then query the table but that seems like a big no-no since you do not have much control in that case. I'm not sure I would ever recommend it - seems like a bad idea to me versus using a background script.

Harsh Vardhan
Giga Patron

do you want to update the existing records? 

if yes then you can try with fix scripts here. 

Brian Bouchard
Mega Sage

Hi Brandon - You can't run a business rule retroactively, but you could run either a scheduled job to determine which records need updating and then do the update, or you could run a fix script to do similar.

Brandon8
Kilo Expert

Fix script seems like a good idea... we try to stay away from scripting though. Would I just need to put the business rule script into it or is there more formatting that goes into it?