CiName and Serial number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 08:27 AM
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#
I am hoping to fix it so it will look like this which is in my PDI.
APPRECIATE YOUR HELP!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 10:02 PM
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