Skip to content

Allow filtering of ObjectVar and MultiObjectVar input selections for scripts #17944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
atownson opened this issue Nov 6, 2024 · 2 comments · Fixed by #18725
Closed

Allow filtering of ObjectVar and MultiObjectVar input selections for scripts #17944

atownson opened this issue Nov 6, 2024 · 2 comments · Fixed by #18725
Assignees
Labels
complexity: low Requires minimal effort to implement status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@atownson
Copy link
Contributor

atownson commented Nov 6, 2024

NetBox version

v4.1.6

Feature type

New functionality

Triage priority

N/A

Proposed functionality

Proposing to extend the functionality of the object selection inputs (ObjectVar and MultiObjectVar) in scripts to be able to filter the selection in the same fashion that's available in the create/edit forms.
image
I might suggest adding the optional parameters selector (boolean with a default of False) and query_params (dictionary) to both ObjectVar and MultiObjectVar classes so that it matches the form parameters. selector=True would show the filter button, and the query_params dictionary to be used to apply the initial filtering.

Use case

Our NetBox instance relies on a few scripts to assist in creating items. Currently we use separate inputs to control filtering (similar to the old behavior of NetBox). Adding the optional filtering would improve the user experience in the same way filtering improved the user experience when using the create/edit forms.

Database changes

None

External dependencies

None

@atownson atownson added status: needs triage This issue is awaiting triage by a maintainer type: feature Introduction of new functionality to the application labels Nov 6, 2024
@bctiemann bctiemann added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation complexity: low Requires minimal effort to implement and removed status: needs triage This issue is awaiting triage by a maintainer labels Nov 7, 2024
@atownson
Copy link
Contributor Author

atownson commented Feb 6, 2025

I can work on this.

@atownson
Copy link
Contributor Author

Could this be assigned to me, please?

@bctiemann bctiemann added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Feb 24, 2025
bctiemann pushed a commit that referenced this issue Mar 6, 2025
… inputs (#18725)

* Add the advanced object selector to the ObjectVar and MultiObjectVar script inputs

* Fix formatting issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: low Requires minimal effort to implement status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants