netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Filtering VLAN Groups by Site does not show VLAN Groups scoped to Locations within that Site

Open candlerb opened this issue 3 years ago • 2 comments

NetBox version

v3.2.8

Python version

3.8

Steps to Reproduce

  1. Create a site "Campus 1"
  2. Create a location "Campus 1 Building 1" within that site
  3. Create a VLAN group which is scoped to this location (see image)
  4. Go to VLAN groups, Filter tab, and filter by site Campus 1

image

Expected Behavior

I was expecting to find the VLAN group.

That is: when filtering by Site, I would expect to see all VLAN groups which belong to Locations within that Site (since Locations are always children or descendants of a given Site).

Observed Behavior

The VLAN group is not found.

candlerb avatar Aug 12 '22 11:08 candlerb

The VLAN group isn't included in the results because the filter is matching only on specific assignment to the selected site. A VLAN group can only be assigned to a site or to a location; the "site" field in the form exists solely to assist in selecting a location (just like the region and site group fields).

We could consider a feature request to modify this behavior, but it would be a breaking change (unless we introduce an alternate filter).

jeremystretch avatar Aug 15 '22 19:08 jeremystretch

I guess such a FR would also have to consider the other case: when you filter on location X, should you also see items in locations Y and Z which are descendants of location X?

That would apply in other places, even just filtering Devices by Location, and there are use cases for both, so it would need a flag to select which behaviour you want.

candlerb avatar Aug 15 '22 20:08 candlerb

I'm going to close this out as not a bug, however if there's still interest we can look at an FR to change the behavior. #10054 might also help with this somewhat.

jeremystretch avatar Aug 25 '22 19:08 jeremystretch