1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #8376: Correct example condition defitinions; call out value vs label ealuation for choice fields

This commit is contained in:
jeremystretch
2022-01-18 11:31:39 -05:00
parent 38963e7960
commit 4b81d86311
3 changed files with 22 additions and 15 deletions

View File

@ -81,13 +81,16 @@ The following condition will evaluate as true:
```json
{
"attr": "status",
"attr": "status.value",
"value": ["planned", "staging"],
"op": "in",
"negate": true
}
```
!!! note "Evaluating static choice fields"
Pay close attention when evaluating static choice fields, such as the `status` field above. These fields typically render as a dictionary specifying both the field's raw value (`value`) and its human-friendly label (`label`). be sure to specify on which of these you want to match.
## Condition Sets
Multiple conditions can be combined into nested sets using AND or OR logic. This is done by declaring a JSON object with a single key (`and` or `or`) containing a list of condition objects and/or child condition sets.
@ -102,7 +105,7 @@ Multiple conditions can be combined into nested sets using AND or OR logic. This
{
"and": [
{
"attr": "status",
"attr": "status.value",
"value": "active"
},
{