Filters in business rule does not work when action is chosen as abort

sakshi garg
Giga Contributor

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.

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

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

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

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.

Hi,

BR evaluates both filter conditions and condition field to decide whether the script within BR should run or not

Regards
Ankur

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

Sulabh Garg
Mega Sage
Mega Sage

Hello Sakshi,

You can restrict BR to run if "Description" is empty using below filter condition.

find_real_file.png

 

Please Mark Correct/helpful, if applicable, Thanks!! 

Regards

Sulabh Garg

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg