- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 05:40 AM - edited 06-30-2025 05:47 AM
Today we are using a Filter condition like this:
The groups can change often, which needs an update to the Business rule, and I want to avoid that.
Is there way to use a script or system property or anything in the 'Filter conditions' or under the 'Condition' field under advanced section and make it dynamic?
PS - I know that can achieve it by writing code in script field, I dont want run the script. I want to run the script only when the condition matches. ie if assignment group is one of (A or B or C) etc
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 06:20 AM
you can check the property value in Advanced condition field of business rule
Filter conditions are for more simpler conditions and advanced condition can handle scripting.
your advanced condition will look like this
system property will hold comma separated sysIds of the 3 groups
gs.getProperty('propertyName').split(',').indexOf(current.assignment_group.sys_id.toString()) > -1
You can also try to use Dynamic filter options, I haven't tested this
Create a dynamic filter option
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 05:57 AM
You can by using the 'condition' field on the 'advanced' tab and write a script include to get the groups from a system property.
But I don't really see any upside to that, because your BR would trigger the lookup to the script include and property and then just doesn't trigger the BR, while you can make it way easier by just applying that in your BR script.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 06:08 AM
The Condition field decides if the Business rule should run or not right. Incase the criteria is not met, the Business rule will not run at all.
If we write the same logic inside the script part, the BR runs, and if the criteria is not met, it stops executing.
If everything (condition logic) is handled with the script field, then why 'Filter Conditions' and 'Condition' field.
Please correct me if my understanding is wrong 🙂
statement to specify when the business rule should run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 02:10 AM
My question was more about the reason behind you don't want to run it. If it triggers and doesn't do a thing because of the script in it, it has the same result as executing a script include to run to decide if the BR needs to run or not.
Ankur's solution will also work, but the BR will be calling the system property to check on the assignment group.
No matter what you do, you will be performing some lookup and script execution to prevent the BR to trigger. My assumption was that you don't want the BR to trigger to not use any instance resources. You will do so, because you need to get the information from somewhere.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 06:31 AM
Thanks for the clarification, Mark:)