- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 08:23 AM
Hi All,
I am using onBefore transform script to implement IRE using below code to identify and ignore duplicate CI.
(function runTransformScript(source, map, log, target ) {
log.info("Status Log ImpSet");
var cmdbUtilIRE = new global.CMDBTransformUtil();
cmdbUtilIRE.setDataSource('ImportSet');
cmdbUtilIRE.identifyAndReconcileEnhanced(source, map, log);
ignore = true;
if (cmdbUtilIRE.hasError()) {
var errorMessage = cmdbUtilIRE.getError();
log.info('Error: ' + errorMessage);
log.error(errorMessage);
} else {
log.info('IE Output Payload: ' + cmdbUtilIRE.getOutputPayload());
log.info('Imported CI: ' + cmdbUtilIRE.getOutputRecordSysId());
}
})(source, map, log, target);
When I run the transform I do not see any logs from CMDBTransformUtil , below is the import set logs
What would be the possible cause can someone please put some light into this to resolve it.?
Solved! Go to Solution.
- Labels:
-
Discovery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2022 12:29 AM
Only thing I can think of now is to check that someone hasn't changed the accessible from for the Script include in your instance, it should be 'all application scopes':-
Happy to have helped even a small bit, please mark my post as useful if it has genuinely helped you.
Thanks,
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 08:53 AM
I don't know if I can guess at the cause of this without further information, but on a related note have you investigated IntegrationHub ETL for importing your CIs? It takes a bit to get acquainted with but it is a much more flexible and reliable method of importing your CI source data using IRE. It is the preferred method for all CMDB imports, and I no longer even bother creating standard transform maps for CMDB data source imports. I would strongly recommend looking into this, because ultimately it will save you time and headaches.
The opinions expressed here are the opinions of the author, and are not endorsed by ServiceNow or any other employer, company, or entity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 11:32 AM
Thanks Paul I will surely give it a try !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 08:57 AM
I expect some kind of exception might be occuring to cause the code to exit. Suggest you wrap the whole thing in a try - catch block and see if you get more detail?
(function runTransformScript(source, map, log, target ) {
try{
log.info("Status Log ImpSet");
var cmdbUtilIRE = new global.CMDBTransformUtil();
cmdbUtilIRE.setDataSource('ImportSet');
cmdbUtilIRE.identifyAndReconcileEnhanced(source, map, log);
ignore = true;
if (cmdbUtilIRE.hasError()) {
var errorMessage = cmdbUtilIRE.getError();
log.info('Error: ' + errorMessage);
log.error(errorMessage);
} else {
log.info('IE Output Payload: ' + cmdbUtilIRE.getOutputPayload());
log.info('Imported CI: ' + cmdbUtilIRE.getOutputRecordSysId());
}
} catch (err){
log.error("Caught Error\n" + err);
}
})(source, map, log, target);
Hope this helps,
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 10:46 AM
Thanks much Richard!
I see an "Catch Error :TypeError: undefined is not a function." after apply try n catch.
Creating CMDBTransformUtil itself is giving the error.
Is this the correct way to call ?