Closed
Description
Deployment Type
Self-hosted
Triage priority
N/A
NetBox Version
v4.1.4
Python Version
3.12
Steps to Reproduce
- Create a required custom field and set a default value. Choose an object like DCIM > Interface.
{
"id": 8,
"display": "My cf",
"object_types": [
"dcim.interface"
],
"type": {
"value": "text",
"label": "Text"
},
"related_object_type": null,
"data_type": "string",
"name": "My_CF",
"label": "",
"group_name": "",
"description": "",
"required": true,
"unique": false,
"search_weight": 1000,
"filter_logic": {
"value": "loose",
"label": "Loose"
},
"ui_visible": {
"value": "always",
"label": "Always"
},
"ui_editable": {
"value": "yes",
"label": "Yes"
},
"is_cloneable": false,
"default": "default_value",
"related_object_filter": null,
"weight": 100,
"validation_minimum": null,
"validation_maximum": null,
"validation_regex": "",
"choice_set": null,
"comments": "",
}
2.Create a module type with a few interfaces.
Now, we have the interfaces from the type module that have been added to the device.
We can see that the default value has not been set.
"custom_fields": {
"My_CF": null
},
Note that in devices with device_type, interface custom fields (for example) are set to the default value
Expected Behavior
We should have the default value and not null. on the same way as on a device type with interfaces, when the device is created, there will be the default value on the interfaces custom field.
Observed Behavior
Interfaces that are created when the module is connected to a device, the default values of custom fields are not set to their default values.