BRs Running even after setAbortAction is true in BR running before them
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2017 05:29 AM
Hello Friends - I have BR X which run on Order = 50 and do the below stuff but I found even though I get error pop up saying invalid insert it does not stop another BR Y which is on order 100,000 . Therefore the WS call is made and data is sent to External integration for an invalid ticket.
Kindly advise how can stop this
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(gs.isInteractive())
{
gs.addErrorMessage('Please assign this Incident to SNOW Group before assigning to External Group');
current.setAbortAction(true);
}
})(current, previous);
- Labels:
-
Integrations
-
Upgrades and Patches

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2017 04:51 AM
That's effectively what I said... Because they are both BEFORE rules, the setAbortAction() is only saying "Don't save this to the database", NOT "Don't run any more BRs."
I don't see this as a bug, just a design error and possibly a misunderstanding of which value to use in the "When" field on a BR.
Move that web service BR to an after (where it should be) and your problem goes away.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2017 05:36 AM
Hello Chuck — The BR2 cannot be written on After insert as I noticed that it does not capture Journal entry. For capturing Journal entry , only before insert is required?
With Regards
Bhupesh Gupta

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2017 05:45 AM
I'd like to see the details of your webservice call on BR2... I wasn't aware of any issues getting the journal entry with getJournalEntry(1) to get that value.
Thank you for the detailed description and experiment above, that's exactly what I said would happen.
Akash mentioned setWorkflow(false). Be VERY careful when using this. Because it works on both BRs and Workflows, it can have unexpected consequences.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2017 05:33 AM
Bhupesh Gupta wrote:
This is what I received from HI support
Issue is reproducible on OOB instance. According to our documentation<http://wiki.servicenow.com/index.php?title=Scripting_in_Business_Rules#Aborting_a_Database_Action_in...>
Strange... I'd have thought they'd recommend a link to Docs, not to the Wiki!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2017 09:51 AM
We are on Helsinki version
With Regards
Bhupesh Gupta