API filtering 'OR' logic not working when filtering components by device ID #2696

Closed
opened 2025-12-29 18:21:10 +01:00 by adam · 1 comment
Owner

Originally created by @ajknv on GitHub (Jun 24, 2019).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.0

Steps to Reproduce

  1. Issue an API query with filter parameters specifying two different related object IDs, for example:
    https://netbox/api/dcim/interfaces/?device_id=2761&device_id=2762

Expected Behavior

API will return interfaces associated with the devices having ids 2761 and 2762.

Observed Behavior

API returned only the interfaces associated with the last given device id, in this case 2762.

Originally created by @ajknv on GitHub (Jun 24, 2019). ### Environment * Python version: 3.6.8 * NetBox version: 2.6.0 ### Steps to Reproduce 1. Issue an API query with filter parameters specifying two different related object IDs, for example: https://netbox/api/dcim/interfaces/?device_id=2761&device_id=2762 ### Expected Behavior API will return interfaces associated with the devices having ids 2761 and 2762. ### Observed Behavior API returned only the interfaces associated with the last given device id, in this case 2762.
adam added the type: bugstatus: accepted labels 2025-12-29 18:21:10 +01:00
adam closed this issue 2025-12-29 18:21:10 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 24, 2019):

FYI this is because we're employing a method-based filter to also match on devices belonging to the same virtual chassis, so it's not covered by the default MultiValue* filters.

@jeremystretch commented on GitHub (Jun 24, 2019): FYI this is because we're employing a method-based filter to also match on devices belonging to the same virtual chassis, so it's not covered by the default `MultiValue*` filters.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2696