"Operation against file 'problem' was aborted by Business Rule 'Transform synchronously^<sys_id>'. Business Rule Stack:Transform synchronously"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 02:23 AM
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?
- Labels:
-
Problem Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 06:33 PM
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"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 01:10 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 03:55 AM
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);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 04:13 AM
HI,
107 is a value of that choice? If yes then try this once.
target.state = '107';
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 04:47 AM