-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Fields on related objects via WebHook #14172
Comments
I'm having a similar scenario where I would like to include more information in the webhook body than what's currently possible, though not limited to custom fields. This is kind of out of my league so please bear with me, but I think one possible solution would be to add the models to the webhook_worker context, with the help of #13427. That way it would be possible to access all of the models, which would include this FR with custom fields. Please let me know if it's a viable path then I can have a look at it if I might be able to solve it and suggest a PR. |
I've applied my patch locally on our netbox instance and it has been working now for a few weeks. I would happily volunteer as an owner and submit a PR. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide. |
This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary. |
NetBox version
v3.3.4
Feature type
Change to existing functionality
Proposed functionality
When a webhook is called for either add or edits, can the dataset include the custom fields on the sub-records ?
It seems currently only the basic (id, display, slug and name) fields are part of the data exported for fields like device role, tenant, site and location etc, when creating a webhook for either a device or virtual machine.
Use case
It would allow users to use custom fields on these sub-record fields to keep NetBox data in sync with a 3rd party databases, typically an asset database etc.
For example: When using a webhook to sync changes made to a device or virtual machine up to an asset database, we would want to expose some of the custom fields on the device role object so that we can link that with the equivalent "asset type" table in our asset database.
eg on the device role we would put an integer field called "Asset Type Record ID" and simply populate this field with the ID for the asset type in our asset database. That way when a new record is added or existing record updated in NetBox, that change can sync through to our asset database, and because the custom field with the ID for the asset type is in that data, we can simply take that and use that to add the record to our asset database.
the only workaround for us would be to ensure the device role names match exactly with our asset database "asset types", which isn't an ideal situation for us.
Plus exposing other custom fields may be beneficial to other users for other use cases as well.
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: