Asset Tag field requires exact match in filtering #1789

Closed
opened 2025-12-29 17:19:09 +01:00 by adam · 1 comment
Owner

Originally created by @lampwins on GitHub (Jun 14, 2018).

Issue type

[ x ] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.5
  • NetBox version: 2.3.3

Description

The asset_tag field on the Device model does not allow for partial string matching with filtering. This causes annoyances related to inconsistency because other fields like name and serial number support partial matching. While an asset tag is generally unique, for longer tag IDs, operators commonly wish to strip the first part of the tag which is not unique when searching.

I would like to see the asset_tag field use the icontains filter in the DeviceFilter
https://github.com/digitalocean/netbox/blob/develop/netbox/dcim/filters.py#L512

Originally created by @lampwins on GitHub (Jun 14, 2018). <!-- Before opening a new issue, please search through the existing issues to see if your topic has already been addressed. Note that you may need to remove the "is:open" filter from the search bar to include closed issues. Check the appropriate type for your issue below by placing an x between the brackets. For assistance with installation issues, or for any other issues other than those listed below, please raise your topic for discussion on our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please note that issues which do not fall under any of the below categories will be closed. Due to an excessive backlog of feature requests, we are not currently accepting any proposals which extend NetBox's feature scope. Do not prepend any sort of tag to your issue's title. An administrator will review your issue and assign labels as appropriate. ---> ### Issue type [ x ] Feature request <!-- An enhancement of existing functionality --> [ ] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) If you are submitting a bug report and have made any changes to the code base, please first validate that your bug can be recreated while running an official release. --> ### Environment * Python version: 3.5 * NetBox version: 2.3.3 <!-- BUG REPORTS must include: * A list of the steps needed for someone else to reproduce the bug * A description of the expected and observed behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description The `asset_tag` field on the Device model does not allow for partial string matching with filtering. This causes annoyances related to inconsistency because other fields like name and serial number support partial matching. While an asset tag is generally unique, for longer tag IDs, operators commonly wish to strip the first part of the tag which is not unique when searching. I would like to see the `asset_tag` field use the icontains filter in the DeviceFilter https://github.com/digitalocean/netbox/blob/develop/netbox/dcim/filters.py#L512
adam added the status: acceptedtype: feature labels 2025-12-29 17:19:09 +01:00
adam closed this issue 2025-12-29 17:19:09 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 18, 2018):

Just to clarify, this will enable partial matching of the asset_tag field in search only (e.g. ?q=ABC123). Filtering directly on the asset_tag field (e.g. ?asset_tag=ABC123) will still require an exact match.

@jeremystretch commented on GitHub (Jul 18, 2018): Just to clarify, this will enable partial matching of the `asset_tag` field in search only (e.g. `?q=ABC123`). Filtering directly on the `asset_tag` field (e.g. `?asset_tag=ABC123`) will still require an exact match.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1789