Unable to update Hardware Asset substate

Sayali_N
Tera Contributor

Hello All,

 

We are facing the issue when updating the substate of the some of the Hardware asset.

We have checked the business rule, client script, flows but there was no such script that causes the issues.

 

When we tried to update the substate through the background script even then it does not get updated, but when we added setWorkflow(false) it got updated.

Also when turned on the script debugger the UI action of save is been detected through which the substate changes to available but after that something is executing at the backend which the clears the value of substate.

 

If anyone has any idea related to this, please let us know.


Thank you!

4 REPLIES 4

JenniferRah
Mega Sage

If it works when you setWorkflow(false), it's probably a business rule. Did you look at the "Restrict child asset update" BR? It looks like it runs when the Substate changes. There may be others, too. That one just stood out.

We have checked the business rule "Restrict child asset update" but it does not executes for those affected assets as its parent is empty.
Also there was no business rule traced in the script debugger

Maik Skoddow
Tera Patron
Tera Patron

Hi @Sayali_N 

 

In ServiceNow, the alm_hardware (hardware asset) table's State and Substate fields are synchronized with corresponding fields on the Configuration Item (CI) record. This synchronization is logical and not always one-to-one. The asset State/Substate and CI Install Status/Hardware Status fields update each other based on configured mappings.

If these mappings are not properly maintained, or if custom States/Substates are introduced without updating the mappings, it can cause inconsistencies and unexpected behavior in updates.

Changes to the asset State/Substate often trigger workflows or business rules that update the CI record accordingly, and vice versa. This can cause subsequent updates or clears of the substate field if the synchronization logic or workflows override your manual changes.

It is recommended to avoid creating custom States/Substates unless you also update the asset-to-CI status mappings to keep them in sync.

When you update the substate via UI or scripts without disabling workflows, business rules and workflows related to asset state management run. These can include logic that resets or clears the substate field based on asset lifecycle rules or CI synchronization.

Using setWorkflow(false) disables the execution of business rules, workflows, and other automation triggered by the update. This allows you to update the substate without interference, which explains why your background script update works only with setWorkflow(false)

The UI action "Save" triggers the update, which runs business rules and workflows that may include logic to reset the substate to maintain consistency with the CI or asset lifecycle state.

This backend logic is a standard ServiceNow process or a custom business rule/flow that enforces valid state-substate combinations or synchronizes asset and CI records.

It is explained pretty well in the following video:

 

Maik

Hello,

We don't have ci associated with those assets.