Update to Asset Table field (state) is causing updates to associated Configuration Item

Suneel9
Tera Contributor

I have a custom that holds some fields data from alm_hardware, cmdb_ci for assets.

SO I have business rules on those tables for updates. The alert calls a script include function that gathers data from these two tables and write them to the custom table. I have a workflow that gets triggered when a record is inserted in the custom table and a business rule when a record updates in the custom table. The business rule in turn triggers workflow.

 

No, when I update alm_hardware "state" field that causing updates to cmdb_ci record (fields like Assigned To and Support Group).

 

Now almost at the same time two business rules getting triggered (alm_hardware & cmdb_ci) and both update same record in the custom table. This causing the alert rule to pass previous data (previous date of alm_hardware state value) for update (caused by cmdb_ci) and updated data (updated alm_hardware state value).

 

As two updates have different values for some of the fields and the workflow is getting executed twice (once with old values and once with new values)

 

the problem starts when the workflow execution that starts with using old data executes after the the execution of workflow with correct vales) and causing wrong updates from workflow (over writing the changes made as part of the other workflow execution with correct data).

 

Is there a way I can force the code from alm_hardware business rule to execute after the code from cmdb_ci business rule code?

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Suneel9 

there are OOB BRs on those tables which sync the information

BR "Update Asset fields on change" on cmdb_ci table

BR "Update CI fields on change" on alm_asset table

Try to do these things

1) Business rule order

  • Navigate to the business rule for alm_hardware and set its order to a higher number (e.g., 200).
  • Navigate to the business rule for cmdb_ci and set its order to a lower number (e.g., 100).

2) Sync and Async BR

  • Set the alm_hardware business rule to run asynchronously by checking the "Run Async" checkbox.
  • Keep the cmdb_ci business rule synchronous.

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

@Suneel9 

Hope you are doing good.

Did my reply answer your question?

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

@Ankur Bawiskar , Thanks for the response. The problem I have is the BR configured for alm_asset table needs to have access to both previous & current records. I need to perform specific actions based on the old value and new value of state field. I did configure the order for BR associated with alm_hardware with higher value compared to the other one. This is working fine most of the times, but I am still seeing a considerable number of updates to alm_hardware table triggering both BRs at the same time and cmdb_ci business rule getting executed just 1 or 2 seconds before BR configured for alm_hardware.