pynetbox icon indicating copy to clipboard operation
pynetbox copied to clipboard

Object update not working for custom fields

Open haki99 opened this issue 1 year ago • 1 comments

pynetbox version

v7.3.3

NetBox version

v4.0.3

Python version

3.11

Steps to Reproduce

Hi all!

I have trying to change an existing IP address's custom field (MAC address) and the code runs successfully but the change is not made to the IP address.

I have tried with these approaches:

With Endpoint update:

netbox.ipam.ip_addresses.update([{
       "id": netbox_ip.id,
       "custom_fields": {
              "Computer_MAC": "some new string mac"
       }
}])

With Respons - request update:

ip_address = netbox.ipam.ip_addresses.get(netbox_ip.id)
ip_address.update({
       "custom_fields": {
                 "Computer_MAC": "some new string mac"
       }
})

In previous Netbox versions this script runned successfully so I think something has changed in the API and Django structure.

Expected Behavior

The custom field of the IP address has changed.

Observed Behavior

The custom field of the IP address has not changed.

haki99 avatar Jun 04 '24 13:06 haki99