Filters in business rule does not work when action is chosen as abort
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 01:31 AM
I created one business rule before insert on incident table. Also added a filter where Description is not empty. In the Actions I have selected abort action and in the advanced section put a filter condition as javascript:new IncidentCreation_by_filters().mainfunction(current.description);
Here IncidentCreation_by_filters is my script include and mainfunction is the function inside script include where I am passing description value.
When I try to create a incident with empty description the flow enters inside this function which should not be the ideal case because filter condition of empty description in the business rule should restrict.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 01:35 AM
Hi,
the condition field would still be evaluated when BR runs and hence the script include function will be called
I didn't get what's your question/confusion?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 03:06 AM
Hi,
I have added 3 attachments in the question posted. My query is, even though I have added a filter condition in the business rule as shown in attachment, while I create a new incident with description field empty the business rule calls the script include function. That means condition is not getting evaluated when Action selected is abort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 03:08 AM
Hi,
BR evaluates both filter conditions and condition field to decide whether the script within BR should run or not
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 01:41 AM