Filter on multiple values for custom fields #5310

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

Originally created by @milonline-eu on GitHub (Sep 3, 2021).

NetBox version

v3.0.1 - Demo instance

Python version

3.9

Steps to Reproduce

Create a Custom field, Type: Multiple selection, Assigned models: DCIM > device, Choices: 1,2
Create a device with custom field set to 1
Create a device with custom field set to 2
Go to filter of devices, choose 1 and 2 for the custom field.

Tested on demo v3.0.1:
https://demo.netbox.dev/dcim/devices/?q=&asset_tag=&mac_address=&has_primary_ip=&virtual_chassis_member=&console_ports=&console_server_ports=&power_ports=&power_outlets=&interfaces=&pass_through_ports=&local_context_data=&cf_Test+multiselect+filter=1&cf_Test+multiselect+filter=2

There are two devices with custom field "Test multiselect filter":
https://demo.netbox.dev/dcim/devices/88/ "Test multiselect filter" set to 1
https://demo.netbox.dev/dcim/devices/89/ "Test multiselect filter" set to 2

Filtering "Test multiselect filter" for "1" and "2" shows only device id 89 (cf_Test+multiselect+filter=1&cf_Test+multiselect+filter=2). I would expect both devices 88 and 89 to be shown.

Expected Behavior

both devices to be shown

Observed Behavior

second device shown only

Originally created by @milonline-eu on GitHub (Sep 3, 2021). ### NetBox version v3.0.1 - Demo instance ### Python version 3.9 ### Steps to Reproduce Create a Custom field, Type: Multiple selection, Assigned models: DCIM > device, Choices: 1,2 Create a device with custom field set to 1 Create a device with custom field set to 2 Go to filter of devices, choose 1 and 2 for the custom field. Tested on demo v3.0.1: https://demo.netbox.dev/dcim/devices/?q=&asset_tag=&mac_address=&has_primary_ip=&virtual_chassis_member=&console_ports=&console_server_ports=&power_ports=&power_outlets=&interfaces=&pass_through_ports=&local_context_data=&cf_Test+multiselect+filter=1&cf_Test+multiselect+filter=2 There are two devices with custom field "Test multiselect filter": https://demo.netbox.dev/dcim/devices/88/ "Test multiselect filter" set to 1 https://demo.netbox.dev/dcim/devices/89/ "Test multiselect filter" set to 2 Filtering "Test multiselect filter" for "1" and "2" shows only device id 89 (cf_Test+multiselect+filter=1&cf_Test+multiselect+filter=2). I would expect both devices 88 and 89 to be shown. ### Expected Behavior both devices to be shown ### Observed Behavior second device shown only
adam added the type: feature label 2025-12-29 19:26:30 +01:00
adam closed this issue 2025-12-29 19:26:30 +01:00
Author
Owner

@DanSheps commented on GitHub (Sep 3, 2021):

This is consistent with 2.11.x, therefore not a bug.

I suspect, but I haven't looked into it, custom fields are only set to filter a single ID and as such only take the last ID.

@DanSheps commented on GitHub (Sep 3, 2021): This is consistent with 2.11.x, therefore not a bug. I suspect, but I haven't looked into it, custom fields are only set to filter a single ID and as such only take the last ID.
Author
Owner

@jeremystretch commented on GitHub (Sep 3, 2021):

Per the bug report template:

Additionally, do not rely on the demo instance for reproducing suspected bugs, as its data is prone to modification or deletion at any time.

You need to provide detailed steps that someone else can follow to reproduce the suspected bug. You haven't even specified the NetBox version.

@jeremystretch commented on GitHub (Sep 3, 2021): Per the bug report template: > Additionally, do not rely on the demo instance for reproducing suspected bugs, as its data is prone to modification or deletion at any time. You need to provide detailed steps that someone else can follow to reproduce the suspected bug. You haven't even specified the NetBox version.
Author
Owner

@milonline-eu commented on GitHub (Sep 3, 2021):

v3.0.1 specified and detailed steps to reproduce it in the description now

@milonline-eu commented on GitHub (Sep 3, 2021): v3.0.1 specified and detailed steps to reproduce it in the description now
Author
Owner

@jeremystretch commented on GitHub (Oct 5, 2021):

This is consistent with 2.11.x, therefore not a bug.

This needs to be resubmitted as a feature request.

@jeremystretch commented on GitHub (Oct 5, 2021): > This is consistent with 2.11.x, therefore not a bug. This needs to be resubmitted as a feature request.
Author
Owner

@milonline-eu commented on GitHub (Nov 10, 2021):

Just tested on 3.1-beta1 and it works fine. And it was solved by #7544

@milonline-eu commented on GitHub (Nov 10, 2021): Just tested on 3.1-beta1 and it works fine. And it was solved by #7544
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5310