detailed change log for json structure used in custom fields #7132

Closed
opened 2025-12-29 20:19:36 +01:00 by adam · 2 comments
Owner

Originally created by @jcralbino on GitHub (Oct 19, 2022).

NetBox version

v3.3.7

Feature type

Change to existing functionality

Proposed functionality

Currently the change log functionality provides the difference of the object changes before and after a change, but this information is not relevant when the change is done within a custom field.

In that case it only identifies that this field changed, without providing a diff inside the custom field json structure.

For example:

  1. In the demo, i have added a new custom field that is assigned to the model "tenancy|tenant"., named "change2". It add already a prexisting one as seen bellow

    image

  2. Then i went to a tenant "Cyberdyne Systems", and changed the two fields creating two different change logs.

    image

  3. In the first change log i changed the custom field "cust_id". In this example the three windows ( Pre-Change Data, Post-Change Data and Difference) are showing only the changed JSON Structure.

    image

  4. In the second change log i changed the custom field "change2". In this example the three windows ( Pre-Change Data, Post-Change Data and Difference) are showing only the changed JSON Structure. But not identifying the field inside the custom field that changed.

    image

What i propose:

  • Provide in the difference window a JSON diff of its content.

  • The window Pre-Change data , and Post-change data, correctly identifies the field that changed. But when we have a JSON structure this information is not correctly shown.

  • Currently for the change of a "primary" field (Description)
    image

  • this can be done by using an improved JSONCompare on example of the required output:
    image

Use case

Improve the UX when analyzing change logs and reviews JSON structure changes.

Database changes

none

External dependencies

Depends of the implementation of the proposed solution.
An additional library that can perform this comparison in Python is deepdiff
but it could be that other solutions exist using the current libraries.
.

Originally created by @jcralbino on GitHub (Oct 19, 2022). ### NetBox version v3.3.7 ### Feature type Change to existing functionality ### Proposed functionality Currently the change log functionality provides the difference of the object changes before and after a change, but this information is not relevant when the change is done within a custom field. In that case it only identifies that this field changed, without providing a diff inside the custom field json structure. For example: 1. In the [demo](https://demo.netbox.de), i have added a new custom field that is assigned to the model "tenancy|tenant"., named "change2". It add already a prexisting one as seen bellow ![image](https://user-images.githubusercontent.com/44149262/196798532-6d4ca9f6-ab5c-42f8-85b5-760ddd4d515b.png) 2. Then i went to a tenant "Cyberdyne Systems", and changed the two fields creating two different change logs. ![image](https://user-images.githubusercontent.com/44149262/196799054-1fb9aa94-8afe-4133-9567-d36b5dab31d3.png) 3. In the first change log i changed the custom field "cust_id". In this example the three windows ( Pre-Change Data, Post-Change Data and Difference) are showing only the changed JSON Structure. ![image](https://user-images.githubusercontent.com/44149262/196800135-5ec5eb13-1c02-4fe9-9a44-ab0e47446583.png) 4. In the second change log i changed the custom field "change2". In this example the three windows ( Pre-Change Data, Post-Change Data and Difference) are showing only the changed JSON Structure. But not identifying the field inside the custom field that changed. ![image](https://user-images.githubusercontent.com/44149262/196800199-c02a74da-3713-4dae-ac3a-f18dfd35abd6.png) What i propose: - Provide in the difference window a JSON diff of its content. - The window Pre-Change data , and Post-change data, correctly identifies the field that changed. But when we have a JSON structure this information is not correctly shown. - Currently for the change of a "primary" field (Description) ![image](https://user-images.githubusercontent.com/44149262/196799972-4a4521fd-e313-4d17-8554-e07d2b178933.png) - this can be done by using an improved JSONCompare on example of the required output: ![image](https://user-images.githubusercontent.com/44149262/196801187-75c1962c-a0a9-45f7-b7ce-54c7446b7aa4.png) ### Use case Improve the UX when analyzing change logs and reviews JSON structure changes. ### Database changes none ### External dependencies Depends of the implementation of the proposed solution. An additional library that can perform this comparison in Python is [deepdiff](https://zepworks.com/deepdiff/current/) but it could be that other solutions exist using the current libraries. .
adam added the type: feature label 2025-12-29 20:19:36 +01:00
adam closed this issue 2025-12-29 20:19:36 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 8, 2023):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Feb 8, 2023): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Feb 17, 2023):

This seems like it's captured by #10924, which proposes the same idea but for the entire diff body.

@jeremystretch commented on GitHub (Feb 17, 2023): This seems like it's captured by #10924, which proposes the same idea but for the entire diff body.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7132