Custom field defaults are not set on templated device/VM components upon creation #8867

Closed
opened 2025-12-29 20:42:19 +01:00 by adam · 1 comment
Owner

Originally created by @jwbensley on GitHub (Nov 22, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.5.9

Python version

3.10

Steps to Reproduce

  • Create a custom field which is required AND has a default value. In this example we have a boolean field which is required and has a default value of False:

grafik

  • Now I create a new device in NetBox based off of an existing device template. We can see it has a bunch of interfaces already defined:

grafik

  • If I examine the interfaces, they all have no value set for this custom field, even though a default is defined:

grafik

  • Each time we create a device, we have to set this value for all the interfaces, every though a default has been defined. This is why I think this is a bug, the default value is not being set.

Expected Behavior

All these interfaces should have this custom field set to False by default as per the custom field definition.

Observed Behavior

All instances of this custom field have no value set which I think is unexpected when you consider that this is a required boolean field, and neither True nor False is set.

Originally created by @jwbensley on GitHub (Nov 22, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.5.9 ### Python version 3.10 ### Steps to Reproduce * Create a custom field which is required AND has a default value. In this example we have a boolean field which is required and has a default value of `False`: ![grafik](https://github.com/netbox-community/netbox/assets/1025875/ed7a7a8d-3a4a-4282-94d0-3af2c2172dbe) * Now I create a new device in NetBox based off of an existing device template. We can see it has a bunch of interfaces already defined: ![grafik](https://github.com/netbox-community/netbox/assets/1025875/95943324-d52b-488f-a12c-ec57bd62c0b6) * If I examine the interfaces, they all have no value set for this custom field, even though a default is defined: ![grafik](https://github.com/netbox-community/netbox/assets/1025875/fe0a6145-d1fc-4568-b7cf-7b9987cded61) * Each time we create a device, we have to set this value for all the interfaces, every though a default has been defined. This is why I think this is a bug, the default value is not being set. ### Expected Behavior All these interfaces should have this custom field set to `False` by default as per the custom field definition. ### Observed Behavior All instances of this custom field have no value set which I think is unexpected when you consider that this is a required boolean field, and neither `True` nor `False` is set.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:42:19 +01:00
adam closed this issue 2025-12-29 20:42:19 +01:00
Author
Owner

@jwbensley commented on GitHub (Dec 13, 2023):

Thanks for the quick fix!

@jwbensley commented on GitHub (Dec 13, 2023): Thanks for the quick fix!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8867