"Operation against file 'problem' was aborted by Business Rule 'Transform synchronously^<sys_id>'. Business Rule Stack:Transform synchronously"

Alamelu1
Tera Contributor

Im trying to update the state of the problem record through an import set API transform script. I get an error

"Operation against file 'problem' was aborted by Business Rule 'Transform synchronously^<sys_id>'. Business Rule Stack:Transform synchronously"

How to resolve this?

30 REPLIES 30

Thanks. 

Using setWorkflow(false), helped preventing the business rule from getting triggered. But the intent of updating the state in the target record did not get solved. I got the below response after the execution of the transform script

 

"status": "ignored",
"sys_id": "45bc77a7db989010ab899f5faa96192e",
"status_message": "No field values changed"

Hi,

This is not an error. This response you got because there is no value change between what you are trying to update.

Thanks,
Ashutosh

I agree. My question as more around why is it not allowing me to update the state of target (problem) record using script. Is it that the state management in problem record allows state changes only through UI actions?

In my 'on before' transform script, I am just trying to parse the incoming payload and based on certain conditions, i'm updating the state and closed_notes in the target record

 

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {


try {
gs.info("Target record: " + target.sys_id);


var parser = new global.JSON();
var parsed = parser.decode(source.u_event_details);
gs.info("Sys_id" + source.u_snow_id);


if (parsed && Object.keys(parsed).length > 0) {

if (parsed.workflowIndicator == 'Problem') {
var state = parsed.issueDetails["Issue Status"];

if (state === 'ignored') {

target.state = 107;
target.close_notes += 'Event ignored in Source system';
} else if (state === 'resolved') {

target.state = 107;
target.close_notes += 'Event resolved in Source system';
}
}
}


} catch (ex) {
var message = ex.getMessage();
}

})(source, map, log, target);

HI,


107 is a value of that choice? If yes then try this once.

target.state = '107';


Thanks,
Ashutosh

Hi,

Is that a valid choice value? did you check the choice list for state field?

out of the box only below state value exists; can you check in your instance

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader