Need help to create CI's from Data Source Import
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 01:41 PM
We are trying to import huge list of CI's and then Assets must be created from that. What is the best way to do this?
I came across this "CMDBTransformUtil Usage in Transform Maps" https://www.servicenow.com/community/cmdb-articles/cmdbtransformutil-usage-in-transform-maps/ta-p/26...
Tried. But, I am getting an error "Error importing CI: createOrUpdateCI failed."
This is my transform map script: onBefore
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
log.info("Status Log ImpSet");
// Call CMDB API to do Identification and Reconciliation of current row
var cmdbUtil = new CMDBTransformUtil();
cmdbUtil.setDataSource('ImportSet');
cmdbUtil.identifyAndReconcileEnhanced(source, map, log);
ignore = true;
if (cmdbUtil.hasError()) {
var errorMessage = cmdbUtil.getError();
log.info('Error: ' + errorMessage);
log.error('Error importing CI: ' + errorMessage);
} else {
log.info('IE Output Payload: ' + cmdbUtil.getOutputPayload());
log.info('Imported CI: ' + cmdbUtil.getOutputRecordSysId());
}
})(source, map, log, target);
I am not a CMDB expert, so I would highly appreciate your help in this.
Thanks.
0 REPLIES 0