After inactivating and activating "Sync Ops Status for CMDB CI", Install status field misbehaving

Vinay Noel
Tera Contributor

Hi All,

I am working on a transform map that populates data to cmdb_ci_service_auto table Operational status and install status fields. The onbefore script of my transform map sets the value of install_status to '7' based on a condition.

Initially this was working and install status was setting to 'Retired' as expected.

 

I had to deactivate and re-activate "Sync Ops Status for CMDB CI" Business rule for testing purpose. After this scenario, I am encountering an issue with the Install_status field not setting to ''Retired" in the initial run of the transform map and it is getting set to "Installed" (Default value). But when i reprocess the import set or do a second run of the data source, the "Install status" gets set to "Retired" as expected.

 

I tested again by deactivating the "Sync Ops Status for CMDB CI" business rule and its working as expected in the first run itself. When ever this business rule is active, the install status is updated to "Retired" only in the second run.

 

PS - This was working as expected in the first run itself before the Business was initially deactivated.

 

Any help is much appreciated !

 

The code from Transfrom script is pasted below for reference -

 

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

 

    // Add your code here

    if (source.u_record_action == "D") {

        target.install_status = 7;  

        target.operational_status = 2;

    }

})(source, map, log, target);

 

 

0 REPLIES 0