Skip to content
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 default value on Objects from modules are not set #17820

Open
Etibru opened this issue Oct 21, 2024 · 0 comments
Open

Custom fields default value on Objects from modules are not set #17820

Etibru opened this issue Oct 21, 2024 · 0 comments
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@Etibru
Copy link

Etibru commented Oct 21, 2024

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.4

Python Version

3.12

Steps to Reproduce

  1. 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.
17295182262847603361889833276334

  1. Create a device, create a module bay on this device.
    17295182378236963683433093075664

  2. Connect a module with the module type
    17295182497146946160325110780536

Now, we have the interfaces from the type module that have been added to the device.
17295182632186578896907287261420

And if we see an Interface:
17295182817146530767661734069473

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.

@Etibru Etibru added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Oct 21, 2024
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows and removed status: needs triage This issue is awaiting triage by a maintainer labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants