I want to change the display name of Asset & to be same as CI

vinzz
Kilo Contributor

Hi,

 

OOB display name of asset is combination of Asset tag & model id.

But I want the display name of asset to be same as CI name.

Please suggest some solution.

 

Thanks

1 ACCEPTED SOLUTION

Hi,

Go to AssetUtils Script include and See beow function and change as i did.


Below is the OOB code which i have modified:

calculateDisplayName : function(asset) {
var display_name = "";
if (asset.asset_tag)
display_name += asset.asset_tag + " - ";
if (asset.model)
//display_name += asset.model.display_name; Instead of this we use below line

display_name += asset.ci.name;

if (asset.display_name == display_name)
return false;

asset.display_name = display_name.trim();
return true;
},

 

Thanks,
Ashutosh Munot

View solution in original post

7 REPLIES 7

Thanks Ashutosh,

I  will try this out.

Thanks

HI,


Please mark answer as correct or helpful if you are satisfied with this answer

 

Thanks,

Ashutosh

Jackie23
Kilo Guru

Hi Ashutosh, 

 

I am having a similar issue and it looks like your solution isn't working for me. I changed the AssetUtils script and verify the business rule, calculateDisplayName, is accurate. Is there anything else I am missing? My display name just shows 'Unknown' in the asset table and I have imported it from the cmdb_ci_computers table. 

 

Any advice?

 

Thanks,

Jackie