Setting install status value on the CI and the asset from the operational status

anfield
Tera Guru

Created a business rule which runs on cmdb_ci_computer(for now) and when I set the CI to decommissioned I want that value to be set on install status on the CI and the asset. This currently only sets that value on the asset (from the CI). Anyone know why this wouldnt set the value on the CI? The value number is correct and the value exists in all 3 menus

 

if (current.operational_status.changesTo(50)){

current.install_status = 50;
current.asset.install_status = 50;

}


})(current, previous);

 

1 ACCEPTED SOLUTION

Michael Fry1
Kilo Patron

To set the asset install status you'll have to use a GlideRecord. Something like this should work:

var asset = new GlideRecord('alm_asset');
    asset.get(current.asset);
    asset.install_status = 7;
    asset.update();

Check the value. Out of box 7 is Retired.

View solution in original post

2 REPLIES 2

Michael Fry1
Kilo Patron

To set the asset install status you'll have to use a GlideRecord. Something like this should work:

var asset = new GlideRecord('alm_asset');
    asset.get(current.asset);
    asset.install_status = 7;
    asset.update();

Check the value. Out of box 7 is Retired.

Thanks Michael. Looks like this is working