- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2020 09:48 AM
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);
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2020 12:07 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2020 12:07 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2020 12:56 PM
Thanks Michael. Looks like this is working