Ability to filter objects (devices/vm, etc) by Contact with specific Contact role #9286

Closed
opened 2025-12-29 20:47:51 +01:00 by adam · 6 comments
Owner

Originally created by @DevFinGitGovSecChatOps on GitHub (Feb 23, 2024).

NetBox version

v3.7.3

Feature type

New functionality

Proposed functionality

This is an extension of https://github.com/netbox-community/netbox/issues/9239 and https://github.com/netbox-community/netbox/pull/8742

At the moment it is not possible to filter a specific object-type (for example vm) by a contact that has a specific role.
(GUI: Virtualization/Virtual Machines/Filters)

For example:

VM Contact Contact Role
vm1 Mario Admin
vm1 Luigi User
vm2 Luigi Admin
vm2 Mario User

Task: "Filter VMs where Mario has the Contact Role Admin"

Behavior: At the moment it shows all vms where Mario is a Contact OR any Contact has the Role Admin

Expected behavior: Show all vms where Mario has the Role Admin (Contact Assignment)

I know there is a filter in tenancy/contact-assignments/ already. It would be really usefull to be able to use it in the above mentioned filters as well.

Use case

It would allow to filter Objects for a user with a specific role combined with additional filters (In case of VM for example by status, location or anything else)

"Show me all VMs with Status Maintenance where I (UserXYZ) have the Contact Role Admin"

Database changes

I don't know

External dependencies

None I guess?

Originally created by @DevFinGitGovSecChatOps on GitHub (Feb 23, 2024). ### NetBox version v3.7.3 ### Feature type New functionality ### Proposed functionality This is an extension of https://github.com/netbox-community/netbox/issues/9239 and https://github.com/netbox-community/netbox/pull/8742 At the moment it is not possible to filter **a specific** object-type (for example vm) by a contact that has a specific role. (GUI: `Virtualization/Virtual Machines/Filters`) For example: | VM | Contact | Contact Role | | --- | ----| ---| | vm1 | Mario | Admin | | vm1 | Luigi | User | | vm2 | Luigi | Admin | | vm2 | Mario | User | Task: "Filter VMs where Mario has the Contact Role Admin" Behavior: At the moment it shows all vms where Mario is a Contact **OR** _any_ Contact has the Role Admin Expected behavior: Show all vms where Mario has the Role Admin (Contact Assignment) I know there is a filter in `tenancy/contact-assignments/` already. It would be really usefull to be able to use it in the above mentioned filters as well. ### Use case It would allow to filter Objects for a user with a specific role combined with additional filters (In case of VM for example by status, location or anything else) "Show me all VMs with Status `Maintenance` where I (UserXYZ) have the Contact Role Admin" ### Database changes I don't know ### External dependencies None I guess?
adam added the type: featurestatus: needs ownerpending closurecomplexity: low labels 2025-12-29 20:47:51 +01:00
adam closed this issue 2025-12-29 20:47:51 +01:00
Author
Owner

@DevFinGitGovSecChatOps commented on GitHub (Feb 27, 2024):

Graphical representation:
grafik

@DevFinGitGovSecChatOps commented on GitHub (Feb 27, 2024): Graphical representation: ![grafik](https://github.com/netbox-community/netbox/assets/52656165/fba56c08-232e-49c0-b559-ff6dfe496e34)
Author
Owner

@Julio-Oliveira-Encora commented on GitHub (Apr 23, 2024):

I tested and was not able to reproduce the issue.

Screenshot from 2024-04-23 15-03-52
Screenshot from 2024-04-23 15-02-18
Screenshot from 2024-04-23 15-07-48

@Julio-Oliveira-Encora commented on GitHub (Apr 23, 2024): I tested and was not able to reproduce the issue. ![Screenshot from 2024-04-23 15-03-52](https://github.com/netbox-community/netbox/assets/149191228/1f0cff84-97ec-4539-9248-faa87e0f6c6c) ![Screenshot from 2024-04-23 15-02-18](https://github.com/netbox-community/netbox/assets/149191228/a96686e5-37d4-439b-8cd3-0ffdab4cc0db) ![Screenshot from 2024-04-23 15-07-48](https://github.com/netbox-community/netbox/assets/149191228/3653c1c3-2e19-4960-b94c-34569fbd528d)
Author
Owner

@DevFinGitGovSecChatOps commented on GitHub (May 3, 2024):

Your screenshots don't really show an exact reproduction of my UseCase.
In your screenshot the Users have the same roles on both VMs, in my example the Users have switched roles on the VMs.

@DevFinGitGovSecChatOps commented on GitHub (May 3, 2024): Your screenshots don't really show an exact reproduction of my UseCase. In your screenshot the Users have the same roles on both VMs, in my example the Users have switched roles on the VMs.
Author
Owner

@Julio-Oliveira-Encora commented on GitHub (May 6, 2024):

I fixed it, and I was able to reproduce the error.

Screenshot from 2024-05-06 16-25-59

vm2

Screenshot from 2024-05-06 16-25-40

We need to verify if the search will do it using the "contact AND his role" or "contact" and "role" as separate fields (current).

@Julio-Oliveira-Encora commented on GitHub (May 6, 2024): I fixed it, and I was able to reproduce the error. ![Screenshot from 2024-05-06 16-25-59](https://github.com/netbox-community/netbox/assets/149191228/f2d4b6ac-6fe2-4c66-9a11-b2ca966bbd53) ![vm2](https://github.com/netbox-community/netbox/assets/149191228/c8fd6240-c866-4a74-ac02-f62fb2bcd65c) ![Screenshot from 2024-05-06 16-25-40](https://github.com/netbox-community/netbox/assets/149191228/cb5eb10a-1409-41bf-afe5-a008e034bd3c) We need to verify if the search will do it using the "contact AND his role" or "contact" and "role" as separate fields (current).
Author
Owner

@github-actions[bot] commented on GitHub (Aug 21, 2024):

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 (Aug 21, 2024): 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

@github-actions[bot] commented on GitHub (Sep 20, 2024):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Sep 20, 2024): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9286