You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use Jinja templating in the webhook body.
I have a webook set to trigger when a VLAN object is created. I also have a custom field for Tenant objects called TenantID.
The webhook communicates with my ERP and I have successfully created a vlan in my ERP when I write this TenantID with a default static value lets say 123.
However each and every VLANs could be for different Tenants, so I need to fetch TenantID for the tenant of the vlan created.
Here is a view from the API (URL/api/ipam/vlans/) :
As you can see there is no field "custom_fields" in the tenant dict...
Would I be able to get it with Jinja2 templating ?
With netbox shell I can do that : vlan.tenant.custom_field_data.get('TenantID') and it returns the value.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I want to use Jinja templating in the webhook body.
I have a webook set to trigger when a VLAN object is created. I also have a custom field for Tenant objects called TenantID.
The webhook communicates with my ERP and I have successfully created a vlan in my ERP when I write this TenantID with a default static value lets say 123.
However each and every VLANs could be for different Tenants, so I need to fetch TenantID for the tenant of the vlan created.
Here is a view from the API (URL/api/ipam/vlans/) :
As you can see there is no field "custom_fields" in the tenant dict...
Would I be able to get it with Jinja2 templating ?
With netbox shell I can do that :
vlan.tenant.custom_field_data.get('TenantID')
and it returns the value.Thanks so much for any solutions provided !
Beta Was this translation helpful? Give feedback.
All reactions