When you see that a CI record which was missing the "Asset" reference field, is now populated by the related asset reference when a model category is added/changed in a cmdb_model record corresponding to that CI. This is due to a business rule "Sync model category"


The "Sync model category" business rule, creates the assets for CI's belonging to the particular model, if they are missing in the first place. So this business rule triggers only when "cmdb_model_category" field on the cmdb_model record changes. If a model category is added or removed from the list, then the business rule is triggered, and it calls createMultipleAssets function from AssetandCI script include. 

Here, it checks all the CI's that belong to the class associated with the cmdb_model_category that was added. Say for example, "hardware" model category was added to a cmdb_model record, then the script checks all the CI's with that model, in cmdb_ci_hardware table to see if the CI's have an asset record associated with them. If an asset record is not associated, then it creates an asset record in alm_harware table and references it to the "asset" field on the CI. 

So this business rule does not always get triggered when cmdb_model records are updated, but only when there is change to the model categories or when they are created. Also if the CI record already has an a proper asset record linked to it, then it would not update the CI record


Article Information

Last Updated:2019-08-02 20:52:54