Skip to content

Add changelogging for Custom Objects #45

@mrmrcoleman

Description

@mrmrcoleman

Plugin Version

commit 003c687 (HEAD -> netbox-models, origin/netbox-models)

NetBox Version

v4.2.8-Docker-3.2.0

Python Version

3.12

Steps to Reproduce

  • Create a COT X
  • Add a field of type text to X
  • Create a CO of type X, Y
  • Navigate to api/core/object-changes/

Expected Behavior

The Custom Object Y shows up in the changelog

Observed Behavior

Only the Custom Object Type and the Custom Object Type Field show up in the changelog:

GET /api/core/object-changes/

HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 2,
            "url": "http://localhost:8001/api/core/object-changes/2/",
            "display_url": "http://localhost:8001/core/changelog/2/",
            "display": "Custom Objects | custom object type field Testtextfield created by admin",
            "time": "2025-06-18T11:14:44.012601Z",
            "user": {
                "id": 1,
                "url": "http://localhost:8001/api/users/users/1/",
                "display": "admin",
                "username": "admin"
            },
            "user_name": "admin",
            "request_id": "e5a60051-9b05-418a-93c4-72816f060e49",
            "action": {
                "value": "create",
                "label": "Created"
            },
            "changed_object_type": "netbox_custom_objects.customobjecttypefield",
            "changed_object_id": 1,
            "changed_object": {
                "id": 1,
                "name": "testtextfield",
                "label": "",
                "custom_object_type": 1,
                "type": "text",
                "primary": true,
                "default": null,
                "choice_set": null,
                "validation_regex": "",
                "validation_minimum": null,
                "validation_maximum": null,
                "related_object_type": null
            },
            "prechange_data": {},
            "postchange_data": {
                "name": "testtextfield",
                "type": "text",
                "label": "",
                "unique": false,
                "weight": 100,
                "default": null,
                "primary": true,
                "comments": "",
                "required": false,
                "choice_set": null,
                "group_name": "",
                "ui_visible": "always",
                "description": "",
                "ui_editable": "yes",
                "filter_logic": "loose",
                "is_cloneable": false,
                "search_weight": 1000,
                "validation_regex": "",
                "custom_object_type": 1,
                "validation_maximum": null,
                "validation_minimum": null,
                "related_object_type": null,
                "related_object_filter": null
            }
        },
        {
            "id": 1,
            "url": "http://localhost:8001/api/core/object-changes/1/",
            "display_url": "http://localhost:8001/core/changelog/1/",
            "display": "Custom Objects | Custom Object Type X created by admin",
            "time": "2025-06-18T11:13:45.745791Z",
            "user": {
                "id": 1,
                "url": "http://localhost:8001/api/users/users/1/",
                "display": "admin",
                "username": "admin"
            },
            "user_name": "admin",
            "request_id": "bd0a201c-918b-47c5-9f29-82c0fa87965f",
            "action": {
                "value": "create",
                "label": "Created"
            },
            "changed_object_type": "netbox_custom_objects.customobjecttype",
            "changed_object_id": 1,
            "changed_object": {
                "id": 1,
                "url": "http://localhost:8001/api/plugins/custom-objects/custom-object-types/1/",
                "name": "X",
                "description": ""
            },
            "prechange_data": {},
            "postchange_data": {
                "name": "X",
                "tags": [],
                "schema": {},
                "description": "",
                "custom_fields": {},
                "verbose_name_plural": ""
            }
        }
    ]
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions