Need help with IRE script and Defaulting the field values

Sneha1996
Kilo Contributor

Hi Team,

I am working on the CMDB integration using REST API. I want to update few fields with default values. When I am turning off my IRE script then only I am able to update those default values but when IRE script is set to true those fields are not updating with Default values. Kindly help me so that both the scripts should work in my integration.

Below are both the scripts :-

 

IRE Script 

 

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
var cmdbUtilIRE = new CMDBTransformUtil();
cmdbUtilIRE.setDataSource('ImportSet');
cmdbUtilIRE.identifyAndReconcileEnhanced(source, map, log);
ignore = true;
if (cmdbUtilIRE.hasError()) {
       var errorMessage = cmdbUtilIRE.getError();
       gs.log(errorMessage);
       gs.addInfoMessage(errorMessage);
} else {
       gs.log('IE Output Payload: ' + cmdbUtilIRE.getOutputPayload());
       gs.log('Imported CI: ' +  cmdbUtilIRE.getOutputRecordSysId());
       gs.addInfoMessage('IE Output Payload: ' + cmdbUtilIRE.getOutputPayload());
       gs.addInfoMessage('Imported CI: ' +  cmdbUtilIRE.getOutputRecordSysId());
} 
})(source, map, log, target);

 

 

Default Script 

 

(function transformRow(source, target, map, log, isUpdate) {
   target.support_group= '019ad92ec7230010393d265c95c260dd';
   target.change_control = '477a05d153013010b846ddeeff7b1225';
})(source, target, map, log, action === "update");

 

 

Please help me to combine both the scripts so that both the scripts can work.

Appreciate your assistance, Thank you !!

0 REPLIES 0