Skip to content

API filter for string custom fields doesn't work properly #19915

@llamafilm

Description

@llamafilm

Deployment Type

Self-hosted

NetBox Version

v4.3.2

Python Version

3.12

Steps to Reproduce

  1. Create a string type custom field called FWversion.
  2. Set this value to 1 on one device, and 10 for another device.
  3. Filter using dcim/devices/?cf_FWversion=1

Expected Behavior

It should return only the device with exactly matching value, according to the documentation:

To filter results by a custom field value, prepend cf_ to the custom field name. For example, the following query will return only sites where a custom field named foo is equal to 123:
GET /api/dcim/sites/?cf_foo=123

Observed Behavior

It returns both devices. I believe it returns all devices where that field contains the value instead of an exact match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationtype: bugA confirmed report of unexpected behavior in the application

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions