I am unable to create or sync configuration item in alm_hardware table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Team,
we are updating alm_hardware table through CSI integration, we can able to update only model. So we have written on After Transform script to update the model category and associated CI. with that script we can able to update only model category but CI is not creating I am giving my script below. i have taken care of cross scoped application on alm_hardware an alm_asset table Could anyone will help in this.
(function(source, target) {
var modelCategorySysId = "sys id of computer model category";
var catGR = new GlideRecord("alm_hardware");
catGR.addEncodedQuery("x_csili_int_csi_correlation_idISNOTEMPTY");
catGR.query();
catGR.setWorkflow(false);
while (catGR.next()) {
// Update the model category on the asset record
gs.info("Processing asset: {0}", [catGR.asset_tag]);
catGR.model_category = modelCategorySysId;
catGR.update();
var modelGr = catGR.model.getRefRecord();
if (modelGr.isValidRecord()) {
// Update the model category on the associated model record
modelGr.cmdb_model_category = modelCategorySysId;
modelGr.update();
}
}
try {
var assGR = new GlideRecord("alm_asset");
(new AssetandCI()).createCI(assGR);
gs.info("CI Created for asset: " + assGR.asset_tag);
} catch (err) {
gs.addErrorMessage("Error creating CI for asset " + assGR.asset_tag + ": " + err);
}
})(source, target);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @PaladugulaM ,
You havent selected any record for assGR
var assGR = new GlideRecord("alm_asset");
(new AssetandCI()).createCI(assGR);
Please check that

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
What stopped you from updating the model category? Needing to do multiple insert/update operations will hinder system performance.
In terms of your posted script, I assume the expectation is that your call to AssetandCI script include will create the necessary CI record. You're not currently passing in a single record, but an unfinished GlideRecord query. The following should work, assuming the target for the transform map is the asset record
new AssetandCI()).createCI(target)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I want to update the records, which i have updated the model categories, how can i achieve this.