Asset tag and configuration item should be same

Aakash Shah4
Tera Guru

Hello Experts,

When i am trying to create a new asset by going to Asset -> All assets -> New -> Hardware

I fill all the mandatory fields along with the field Asset tag.

After submitting the form the Configuration Item is filled with the same name as the Asset tag.

This is happening with the Fuji Release but not in the Istanbul release.

In Fuji :

find_real_file.png

In Istanbul

find_real_file.png

Any suggestions on this ?

1 ACCEPTED SOLUTION

At least with Helsinki, the logic is to create a new CI if one does not exist for the asset, which can lead to duplicate CIs.



This is the createCI function in the AssetandCI Script Include:


var ci = new GlideRecord(ciClass);


ci.initialize();


ci.asset = asset.sys_id;


// in the absence of a calculated name for CIs, set


// something so links don't appear blank


ci.name = asset.model.name;


// Populate manufacturer


ci.manufacturer = asset.model.manufacturer;



// inherit values from asset for shared fields


var sync = new AssetAndCISynchronizer();


sync.syncRecordsWithoutUpdate(asset, ci, 'cmdb_ci', false);



// insert CI record and stick its reference in the asset


asset.ci = ci.insert();



When it creates the CI, the display name will be the asset model name.   You can either change this script to set the CI name to asset.asset_tag or set the display field for CI to asset_tag which will apply to every form.


View solution in original post

8 REPLIES 8

Julian Hoch
ServiceNow Employee
ServiceNow Employee

The "configuration item" is actually a reference field, and will show you the display name.


You should check which field is set as the   display value on the configuration item (by default it's not the asset tag) and change that if necessary.


Or, you might want to use a business rule to set the name of the created CI to use its asset tag.


Hi Julian,



Could you please let me know from where can i set the display value of the Configuration Item Field similar to asset tag.


Paramahanns
Tera Expert

HI Aakash,



In the Helsinki version of my instance I see the below. When a new Hardware asset is the created. The display name and configuration item is being calculated with the below logic.



-Business Rule - Calculate display name


updateDisplayName


Script Include - AssetUtils and then it calls a function name called calculateDisplayName



This is calculated based on the


Display Name = Asset Tag + Configuration Item



-Create CI on insert Business rule


Script include   AssetandCI Function is createCI


When a new Hardware Asset is created . It looks for the model that is being chosen by the user and it sets the Configuration name value from the Model record name value



Hope this helps.



Please mark it as correct or helpful if this gives you some value.



Regards


Param


At least with Helsinki, the logic is to create a new CI if one does not exist for the asset, which can lead to duplicate CIs.



This is the createCI function in the AssetandCI Script Include:


var ci = new GlideRecord(ciClass);


ci.initialize();


ci.asset = asset.sys_id;


// in the absence of a calculated name for CIs, set


// something so links don't appear blank


ci.name = asset.model.name;


// Populate manufacturer


ci.manufacturer = asset.model.manufacturer;



// inherit values from asset for shared fields


var sync = new AssetAndCISynchronizer();


sync.syncRecordsWithoutUpdate(asset, ci, 'cmdb_ci', false);



// insert CI record and stick its reference in the asset


asset.ci = ci.insert();



When it creates the CI, the display name will be the asset model name.   You can either change this script to set the CI name to asset.asset_tag or set the display field for CI to asset_tag which will apply to every form.