Business Rule not updating record during Import Set transformation

johnsgp
Mega Expert

I have an import set transformation set up which imports the field kb_knowledge.short_description amongst others.   I also have an advanced "After" business rule looking at inserts and updates on the kb_knowledge table and which alters the same field.

The business rule works if I activate it from the Knowledge Article form (e.g., going to an article from the "Unpublished" menu and clicking Save or Update).

There are log statements in the business rule to prove that it is actually running and changing the field when the business rule runs.   I have checked that these log entries happen during the transformation of the import set.

Yet when I look at the record after the dust settles, it has the value from the import set, not the value from the business rule.

I tried changing the "Order" of the business rule to 1000 so that it runs after everything else (according to Execution Order of Scripts and Engines - ServiceNow Wiki) but it has not helped.

What could be overriding the business rule?   The "History" on the knowledge article does not show an attempt to save the change, so it is as if the current.update() statement is not working in the business rule when it is run during an import set transformation.

5 REPLIES 5

rtecall
Kilo Contributor

Can you confirm the tick box in the transform map is checked for "Run business rules"?



Have you tried to update the field in the transform map via a source script?


Hi Coleena,



Yes the box is "Run business rules" box is ticked and as I mentioned, I have confirmed that the rule actually runs by placing gs.log statements in it and checking that they do indeed generate log output in the Script Log.   It is very puzzling.



I cannot update the field with a transform script because I need to do a calculation based on a field that is not imported, so it's vital the business rule runs after the import has saved.   Perhaps this is the problem - the import is saving last and thus overriding all the business rules when it comes to fields that are imported.   Would that be classified as a bug, perhaps? Especially since I've set the business rule Order to 1000.


Kalaiarasan Pus
Giga Sage

Can you do a log and check if the value is getting calculated in the Business rule


Hi Kalaiarasan,



Yes, I checked that the calculation is working correctly.   The only thing that seems to fail is the update().