Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

createOrUpdateCI failed error while transforming the data

Appy2
Tera Contributor

Hi All,
I need to import the data in "cmdb_ci_endpoint_nat" table and also need to apply IRE so i have written onBefore transform map script as below :

(function runTransformScript(source, map, log, target) {
// Call CMDB API to do Identification and Reconciliation of current row
var cmdbUtil = new CMDBTransformUtil();
//cmdbUtil.identifyAndReconcile(source, map, log);
cmdbUtil.setDataSource('ImportSet');
ignore = true;

if (cmdbUtil.hasError()) {
        var errorMessage = cmdbUtil.getError();
        log.error(errorMessage);
} else {
        log.info('IE Output Payload: ' + cmdbUtil.getOutputPayload());
        log.info('Imported CI: ' + cmdbUtil.getOutputRecordSysId());
}

})(source, map, log, target);
 
But i am getting below error
Appy2_0-1725263030328.png

Any idea how can we fix this error.?

1 REPLY 1

Community Alums
Not applicable

Hi @Appy2 ,

May be there is some error in your script include that you are calling, can you paste the script of your script include - cmdbUtil and function setDataSource()

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak