Filter on custom field of type Integer via API returns every item #5005

Closed
opened 2025-12-29 19:23:06 +01:00 by adam · 2 comments
Owner

Originally created by @luitzifa on GitHub (Jun 16, 2021).

NetBox version

v2.11.6

Python version

3.7

Steps to Reproduce

  1. Create a custom_field "someid" for ip-addresses of type Integer with min value 1 and max value 255. Default is left emtpy which will get filled with "null"
  2. Try to filter for ip-addresses with value greater than equal 1 like described in the docs https://netbox.readthedocs.io/en/stable/rest-api/filtering/ => https://netbox/api/ipam/ip-addresses/?cf_someid__gte=1

Expected Behavior

Get those ip-addresses with custom_field someid containing a number between 1-255.

Observed Behavior

I get all ip-adresses, even those with

"custom_fields": {
      "someid": null
 },
Originally created by @luitzifa on GitHub (Jun 16, 2021). ### NetBox version v2.11.6 ### Python version 3.7 ### Steps to Reproduce 1. Create a custom_field "someid" for ip-addresses of type Integer with min value 1 and max value 255. Default is left emtpy which will get filled with "null" 2. Try to filter for ip-addresses with value greater than equal 1 like described in the docs https://netbox.readthedocs.io/en/stable/rest-api/filtering/ => https://netbox/api/ipam/ip-addresses/?cf_someid__gte=1 ### Expected Behavior Get those ip-addresses with custom_field someid containing a number between 1-255. ### Observed Behavior I get all ip-adresses, even those with ``` "custom_fields": { "someid": null }, ```
adam closed this issue 2025-12-29 19:23:06 +01:00
Author
Owner

@luitzifa commented on GitHub (Jun 16, 2021):

I don't now if this is related to #6572 because the other issue is strongly focused on the type date.

@luitzifa commented on GitHub (Jun 16, 2021): I don't now if this is related to #6572 because the other issue is strongly focused on the type date.
Author
Owner

@jeremystretch commented on GitHub (Jun 16, 2021):

NetBox doesn't currently support lookups on custom fields. I've opened #6615 to propose this feature. Please keep an eye on that issue for updates.

@jeremystretch commented on GitHub (Jun 16, 2021): NetBox doesn't currently support lookups on custom fields. I've opened #6615 to propose this feature. Please keep an eye on that issue for updates.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5005