Filtering on multi-selection custom field is not performing exact match #5268

Closed
opened 2025-12-29 19:26:05 +01:00 by adam · 0 comments
Owner

Originally created by @candlerb on GitHub (Aug 31, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.12

Python version

3.7

Steps to Reproduce

  1. Create a custom field
    • Type: Multiple Selection
    • Name: snmp_module
    • Label: SNMP Module
    • Content Types: DCIM > device
    • Choices: if_mib,if_mib1,keepalived1
  2. On some devices set module if_mib; on some devices set if_mib1
  3. Browse to /dcim/devices/, filter on this custom field and select if_mib

image

-->

image

Note that this is an exact match from a set of choices, and not a substring match.

Expected Behavior

If I select if_mib as the choice, it should show only those devices which have choice if_mib

Observed Behavior

If I select if_mib as the choice, it shows devices with either if_mib or if_mib1 as the choice. Add "SNMP Module" to the table columns to see this.

(Aside: if I select both if_mib1 and keepalived1 then it shows only devices with both if_mib1 and keepalived1 selected. This is consistent with tags, rather than, say, sites. I think being consistent with tags is correct here)

Originally created by @candlerb on GitHub (Aug 31, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.12 ### Python version 3.7 ### Steps to Reproduce 1. Create a custom field * Type: Multiple Selection * Name: `snmp_module` * Label: `SNMP Module` * Content Types: `DCIM > device` * Choices: `if_mib,if_mib1,keepalived1` 2. On some devices set module `if_mib`; on some devices set `if_mib1` 3. Browse to `/dcim/devices/`, filter on this custom field and select `if_mib` ![image](https://user-images.githubusercontent.com/44789/131495281-21c0f5fc-da94-4919-8416-b5daa3c3944b.png) --> ![image](https://user-images.githubusercontent.com/44789/131495148-e82b4e40-2984-46f9-8c2e-f5b098a4b068.png) Note that this is an exact match from a set of choices, and not a substring match. ### Expected Behavior If I select `if_mib` as the choice, it should show only those devices which have choice `if_mib` ### Observed Behavior If I select `if_mib` as the choice, it shows devices with either `if_mib` or `if_mib1` as the choice. Add "SNMP Module" to the table columns to see this. (Aside: if I select both `if_mib1` and `keepalived1` then it shows only devices with *both* `if_mib1` and `keepalived1` selected. This is consistent with tags, rather than, say, sites. I think being consistent with tags is correct here)
adam added the type: bugstatus: accepted labels 2025-12-29 19:26:05 +01:00
adam closed this issue 2025-12-29 19:26:05 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5268