Expand Custom Fields Object Assignment to support filters in custom field definition #6401

Closed
opened 2025-12-29 19:40:15 +01:00 by adam · 4 comments
Owner

Originally created by @michael-edobor on GitHub (Apr 25, 2022).

NetBox version

v3.2.1

Feature type

Data model extension

Proposed functionality

Introduce the ability to allow users to filter objects in UI (by configurable parameters) while assigning 'objects' as custom fields to various models. This is somewhat similar to the query_set behavior in Custom scripts. To reduce complexities, this feature can be limited to single-selection Objects.

Use case

A sample use-case is a user trying to assign a parent routed 'interface' to a 'vlan group' as a custom field. The drop-down for selection brings up a list of all 'interface objects' on netbox with their 'names' so the user has a a lot of interfaces not knowing which devices those interfaces belong to as the label or name 'GigabitEthernet0/1' likely exists across multiple devices.

image

A short term fix for this specific use-case could be representing 'interface objects' by '$parent device.name: $interface' or '$interface.id: $interface.name'. A more long-term solution will be giving the option use query_params in the UI. e.g

query_params={ 'device': '$device_id', }

Presently, the correct assignment can only be achieved using a custom script to filter that object in UI and then assign the correct interface.

Database changes

Not sure

External dependencies

Not sure

Originally created by @michael-edobor on GitHub (Apr 25, 2022). ### NetBox version v3.2.1 ### Feature type Data model extension ### Proposed functionality Introduce the ability to allow users to filter objects in UI (by configurable parameters) while assigning 'objects' as custom fields to various models. This is somewhat similar to the query_set behavior in Custom scripts. To reduce complexities, this feature can be limited to single-selection Objects. ### Use case A sample use-case is a user trying to assign a parent routed 'interface' to a 'vlan group' as a custom field. The drop-down for selection brings up a list of all 'interface objects' on netbox with their 'names' so the user has a a lot of interfaces not knowing which devices those interfaces belong to as the label or name 'GigabitEthernet0/1' likely exists across multiple devices. ![image](https://user-images.githubusercontent.com/97886385/165160673-e84ec2e7-88ea-439f-89ec-3d81d5b9d6d1.png) A short term fix for this specific use-case could be representing 'interface objects' by '$parent device.name: $interface' or '$interface.id: $interface.name'. A more long-term solution will be giving the option use query_params in the UI. e.g `query_params={ 'device': '$device_id', }` Presently, the correct assignment can only be achieved using a custom script to filter that object in UI and then assign the correct interface. ### Database changes Not sure ### External dependencies Not sure
adam added the type: featurepending closure labels 2025-12-29 19:40:15 +01:00
adam closed this issue 2025-12-29 19:40:15 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 25, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jun 25, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Jul 25, 2022):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Jul 25, 2022): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Author
Owner

@darcynz commented on GitHub (Sep 14, 2022):

Is it possible to re open this. We came accross this issue and am not sure its even possible to find an object like an interface with out its parent object details.. eg Device..

@darcynz commented on GitHub (Sep 14, 2022): Is it possible to re open this. We came accross this issue and am not sure its even possible to find an object like an interface with out its parent object details.. eg Device..
Author
Owner

@darcynz commented on GitHub (Sep 14, 2022):

@michael-edobor hope you dont mind, i raised #10360

@darcynz commented on GitHub (Sep 14, 2022): @michael-edobor hope you dont mind, i raised #10360
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6401