Display contact of parent objects #10511

Closed
opened 2025-12-29 21:32:25 +01:00 by adam · 7 comments
Owner

Originally created by @m0nkeyc0de on GitHub (Nov 25, 2024).

Originally assigned to: @alehaa on GitHub.

NetBox version

v4.1.7

Feature type

Other

Triage priority

N/A

Proposed functionality

When contacts are assigned to an objet which can have child objects (for example Site Group, Site, Location, ...) they don't appear in the contact list of the child objects.

A contact assigned to a Site Group is very likely valid for a Sites of the Site Group (otherwise it would be assigned to the Site itself).
The same logic can be applied for the "Site > Location", "Location > Location" relationships.

The contacts of all parent objects should be visible in the contact list of the child objects.

Use case

NetBox users will spend less time assigning Contacts and will also more quickly have access to all relevants Contacts for a Location.

Database changes

No database change is needed as it's in the GUI.

Maybe a setting could be added to enable/disable that feature.

External dependencies

No external dependencies

Originally created by @m0nkeyc0de on GitHub (Nov 25, 2024). Originally assigned to: @alehaa on GitHub. ### NetBox version v4.1.7 ### Feature type Other ### Triage priority N/A ### Proposed functionality When contacts are assigned to an objet which can have child objects (for example Site Group, Site, Location, ...) they don't appear in the contact list of the child objects. A contact assigned to a Site Group is very likely valid for a Sites of the Site Group (otherwise it would be assigned to the Site itself). The same logic can be applied for the "Site > Location", "Location > Location" relationships. The contacts of all parent objects should be visible in the contact list of the child objects. ### Use case NetBox users will spend less time assigning Contacts and will also more quickly have access to all relevants Contacts for a Location. ### Database changes No database change is needed as it's in the GUI. Maybe a setting could be added to enable/disable that feature. ### External dependencies No external dependencies
adam added the type: featurestatus: backlogcomplexity: low labels 2025-12-29 21:32:26 +01:00
adam closed this issue 2025-12-29 21:32:26 +01:00
Author
Owner

@alehaa commented on GitHub (Feb 8, 2025):

I like this FR and think its fairly easy to implement. If accepted, I volunteer to provide a PR for this.

  1. I'd change ObjectContactsView to check in get_children(), whether parent is a NestedGroupModel. If so, one can filter for all parents including the child, otherwise just the child as it does now.
  2. If needed, views could extend this filterset as needed. I'm think about showing contacts of the site if a location is accessed (e.g. facility manager of a Site, also responsible for the Location).

Of course, the contacts should be sorted in a meaningful way, e.g. from most specific to least specific.

@alehaa commented on GitHub (Feb 8, 2025): I like this FR and think its fairly easy to implement. If accepted, I volunteer to provide a PR for this. 1. I'd change `ObjectContactsView` to check in [`get_children()`](https://github.com/netbox-community/netbox/blob/main/netbox/tenancy/views.py#L25-L29), whether `parent` is a `NestedGroupModel`. If so, one can filter for all parents including the child, otherwise just the child as it does now. 2. If needed, views could extend this filterset as needed. I'm think about showing contacts of the site if a location is accessed (e.g. facility manager of a `Site`, also responsible for the `Location`). Of course, the contacts should be sorted in a meaningful way, e.g. from most specific to least specific.
Author
Owner

@arthanson commented on GitHub (Feb 13, 2025):

@alehaa do you want me to assign this to you?

@arthanson commented on GitHub (Feb 13, 2025): @alehaa do you want me to assign this to you?
Author
Owner

@rboucher-me commented on GitHub (Feb 13, 2025):

This would also require an update in the API. Both in the API and UI we should indicate from where the contact was inherited.

@rboucher-me commented on GitHub (Feb 13, 2025): This would also require an update in the API. Both in the API and UI we should indicate from where the contact was inherited.
Author
Owner

@alehaa commented on GitHub (Feb 13, 2025):

@arthanson you can assign this to me. However, I'm a little confused by the "needs milestone" tag. Doesn't that mean we're waiting for confirmation if and when the maintainers allow submissions?

@alehaa commented on GitHub (Feb 13, 2025): @arthanson you can assign this to me. However, I'm a little confused by the "needs milestone" tag. Doesn't that mean we're waiting for confirmation if and when the maintainers allow submissions?
Author
Owner

@arthanson commented on GitHub (Feb 13, 2025):

@alehaa assigned. The needs milestone means that it will cause API changes or such that can't be done in a minor point release. This would be included in the upcoming 4.3 release.

@arthanson commented on GitHub (Feb 13, 2025): @alehaa assigned. The needs milestone means that it will cause API changes or such that can't be done in a minor point release. This would be included in the upcoming 4.3 release.
Author
Owner

@alehaa commented on GitHub (Feb 16, 2025):

@rboucher-me, can you please elaborate on what changes you think are needed for the API? Unlike the UI views, there are currently no individual contact assignment API endpoints per object type, only the generic /api/tenancy/contact-assignments/. So the logic for extending returned contacts would be different for these two concepts.

@alehaa commented on GitHub (Feb 16, 2025): @rboucher-me, can you please elaborate on what changes you think are needed for the API? Unlike the UI views, there are currently no individual contact assignment API endpoints per object type, only the generic `/api/tenancy/contact-assignments/`. So the logic for extending returned contacts would be different for these two concepts.
Author
Owner

@alehaa commented on GitHub (Apr 13, 2025):

@bctiemann I think this issue accidentally made it into the v4.2.5 changelog. As far as I know, it was only merged into the feature branch.

@alehaa commented on GitHub (Apr 13, 2025): @bctiemann I think this issue accidentally made it into the v4.2.5 changelog. As far as I know, it was only merged into the `feature` branch.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10511