IRE not being executed while using importSet using onBefore transform script

gaurav72
Tera Contributor

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 

find_real_file.png

What would be the possible cause can someone please put some light into this to resolve it.? 

1 ACCEPTED SOLUTION

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':-

find_real_file.png

Happy to have helped even a small bit, please mark my post as useful if it has genuinely helped you.

Thanks,

Richard

View solution in original post

8 REPLIES 8

I am assuming you are in a scoped app?

Any reason why you are using identifyAndReconcileEnhanced instead of identifyAndReconcile?

I don't currently see any issues with how you are instantiating the SI, I am wondering if you put log lines in directly after

		var cmdbUtilIRE = new global.CMDBTransformUtil();
log.info("SI instantiated");
		cmdbUtilIRE.setDataSource('ImportSet');
log.info("Datasource set");
		cmdbUtilIRE.identifyAndReconcileEnhanced(source, map, log);
log.info("identifyAndReconcile complete");
		ignore = true;

If that would get you any closer to where the exception is being thrown...

Richard

Thanks for your prompt response Richard. It is very helpful, I appreciate it.

I tried placing logs it is throwing exception where I am instantiating the SI. I do not see the log ("SI Instantiated") , I see the log statement I placed before that line.

Where shall I focus to debug this issue to take this ahead , suggestions would be helpful .

You are correct I am in scoped application .

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':-

find_real_file.png

Happy to have helped even a small bit, please mark my post as useful if it has genuinely helped you.

Thanks,

Richard

Thanks much Richard !! After allowing to access from all application scope it worked as expected..

Thanks for your suggestion !!