Snapshot Prechange null in Webhook generated by Custom Script Change #10397
-
Netbox v3.1.11 I've written a custom script in NetBox to make changes to a dcim interface. I've also got a webhook for updates to object type dcim interface that initiates an Ansible playbook to make the config changes for the interface on the physical device. Issue is, when using the script to make the interface updates in NetBox, the webhook's payload shows prechange for snapshots as being null and only postchange is defined. If I make the same updates to the interface via the GUI, prechange is defined. Is this to be expected or could this be a bug? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You have to call There's an accepted issue for documenting this in the custom script documentation. |
Beta Was this translation helpful? Give feedback.
You have to call
object.snapshot()
before modifying it. Netbox does this internally when fetching the object, but you must do it yourself in custom scripts.There's an accepted issue for documenting this in the custom script documentation.
#9651