CiName and Serial number

ND7
Kilo Sage

Dear Experts, 

 

we are facing an issue with duplication, The reason the serial number is not populating with ci, even though the script on assetandci has 

 

if (ciClass != '') {
var ciSysId;
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
var assetCMDBUtil = new AssetCMDBUtil();
if (asset.install_status != 2
&& !gs.nil(asset.serial_number)
&& assetCMDBUtil.isSerialNumberMandatory(asset.model_category)) {
ci.name = asset.serial_number + ' - ' + asset.model.name;
ciSysId = assetCMDBUtil.createCIUsingIRE(ci);
} else {
ciSysId = ci.insert();
}
asset.ci = ciSysId;
}
},

 

not showing serial number#

ND7_0-1706632033372.png

 

 

 

 

I am hoping to fix it so it will look like this which is in my PDI. 

ND7_1-1706632033373.png

 

 

APPRECIATE YOUR HELP! 

1 REPLY 1

AJ-TechTrek
Giga Sage
Giga Sage

Hi @ND7 ,

 

Correct me if my understanding are wrong, you want to Amend the serial number in the configuration item filed on asset table and configuration items field is reference of Cmdb table.

 

If i am not wrong, the OOB behaviour of display CI name will be populated based the CI host/name, You can change the display value of for Configuration item after ammeding the Serial Number with hostname of CI.

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.

 

Thanks

AJ

Linkedin Profile:- https://www.linkedin.com/in/ajay-kumar-66a91385/

ServiceNow Community Rising Star 2024