Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Business Rule "when to run" conditions AND Script Include from Condition on Advanced

SimonSimon
Giga Sage

Hello there,

 

I am new to ServiceNow and scripting and I would like to add a condition Script Include to my current VIP business rule that already has bunch of "when to run" conditions. From what I've read, if there are "when to run" conditions and a condition Script Include then both of those need to evaluate TRUE, which does not fit my scenario.

 

My VIP business rule has multiple blocks to check if the user is: active, title contains, department is. The last block is an exception list of specific active users that are also a VIP without meeting any of the other conditions.

 

VIP BRVIP BR

 

 

 

Ideally, I would like replace the exception list with "OR is part of the VIP group".

 

Am I correct to assume that I will have to move ALL of the conditions from "when to run" to the condition Script Include?

1 ACCEPTED SOLUTION

Tony Chatfield1
Kilo Patron

Hi, based on your post I think the tidiest solution may be to set common values in your filter conditions (or condition) field IE active == true and include your other conditional checks within your BR's script IE

if(conditionX || (contitionY && condtionZ) || condtionA) {

//do something

}

The BR will always run to evaluate the conditions (and this may not be ideal) but it is a good compromise for more complex requirements.

View solution in original post

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, based on your post I think the tidiest solution may be to set common values in your filter conditions (or condition) field IE active == true and include your other conditional checks within your BR's script IE

if(conditionX || (contitionY && condtionZ) || condtionA) {

//do something

}

The BR will always run to evaluate the conditions (and this may not be ideal) but it is a good compromise for more complex requirements.