I want to use IRE with ImportSet

gaurav72
Tera Contributor

Hi All,

I am populating CI using import set table I want to check if record is already present and update the record I enabled 'coalesce' it was good but I need to achieve this functionality using IRE so I used below script

https://docs.servicenow.com/bundle/rome-servicenow-platform/page/product/configuration-management/co...

Still it is creating duplicate record in target table , can someone please help if I am missing something.

 find_real_file.png

1 ACCEPTED SOLUTION

SELECT Username
ServiceNow Employee
ServiceNow Employee

As others have noted, you're most likely missing an identification rule or mapping the wrong data into a field (so as not to cause a match).  You can enable debugVerbose logging and check out what's going on in the process to confirm.

Properties for Identification and Reconciliation (servicenow.com)

In your script, it would also be a good idea to set a Discovery Source to make things easier to understand in the logs:

cmdbUtilIRE.setDiscoverySource([source name]);

 

If you haven't already, you'll need to register the Discovery Source first, though. You can do that in a fix script:

var sourceName = “[source name]”,

dsUtil = new global.CMDBDataSourceUtil();

dsUtil.addDataSource(sourceName);

 

Looking at your initial post, it should be a given, but we ought to confirm...your Import Set's target table is in the CMDB, correct?

View solution in original post

7 REPLIES 7

Hello Gaurav,

Could you please share the code how does it look after you have added the discovery source?

Just want to see in what order you are doing this.

Thanks,

Sunny.

gaurav72
Tera Contributor

var UtilIRE = new global.CMDBTransformUtil();
UtilIRE .setDataSource('ImportSet');
UtilIRE .identifyAndReconcileEnhanced(source, map, log);
ignore = true;

if (UtilIRE .hasError()) {
var errorMessage = UtilIRE .getError();
log.error(errorMessage);
} else {
log.info('Out Payload: ' + UtilIRE.getOutputPayload());
log.info('In CI: ' + UtilIRE.getOutputRecordSysId());
}

Hi Gaurav,

Good Morning,

can you share complete code which you write ?

Regards

Anil Sharma