- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 03:11 PM
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 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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 04:05 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 04:05 PM
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.