- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 08:02 AM
I have several physical server assets (eg. Windows Servers)... where we have re-allocated them as Linux Servers. I can change the class on the CI... but the model category on the corresponding asset is still 'Windows Server'.
This doesn't appear to be enabled, even for adminstrators, 'out of the box'. I assume it's because the complexity and rules & processing around asset/ci creation.
How can I update the Asset record with the correct model category?
Solved! Go to Solution.
- Labels:
-
Enterprise Asset Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 08:10 AM
You are correct that there is nothing there and makes sense that the function or type of sever is not defined or changes during the lifecycle. In the past I have added a business rule on the cmdb_ci table to look for changes in class and has an asset record to do something like this below:
updateAssetMC();
function updateAssetMC(){
var asset = current.asset;
var newClass = getModelCat(current.sys_class_name);
var gr = new GlideRecord('alm_asset');
gr.addQuery('sys_id',asset);
gr.query();
if(gr.next()){
if(newClass){
gr.model_category = newClass;
gr.update();
}
}
}
function getModelCat(c){
var gr = new GlideRecord('cmdb_model_category');
gr.addQuery('cmdb_ci_class',c);
gr.query();
if(gr.next()){
return gr.sys_id;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
There is a YT Video that tells you how you can update it per record
Theres a YT Video that tells you how to update it by record
Updating the Model Category of an Existing Asset in ServiceNow - YouTube