Add tenancy groups to bulk import #9174

Closed
opened 2025-12-29 20:46:32 +01:00 by adam · 4 comments
Owner

Originally created by @thiagomarafeli on GitHub (Jan 30, 2024).

NetBox version

v3.7.1

Feature type

Data model extension

Proposed functionality

When you try to bulk import Locations (e.g.) with a tenancy that is not unique, it prompts you an error saying that. But, it is allowed to create multiple Tenancies with the same name (and slug), but it has to be in different groups.
So, it would be nice if I can specify the Tenancy group also, because, without that, I can't import it.

Use case

I have a tenancy group with name and slug "X" and "Y"
I have a tenancy with name and slug "A" in group "X"
I have a tenancy with name and slug "A" in group "Y"
I have a tenancy with name and slug "A" in no group

I want to import it, a Location that it is in tenancy "A", which is in group "Y", without any problems
Nowadays, there's no "tenancy group" field option in import and, if you use "A" in Tenancy field, it raises:
Record 1 tenant: "A" is not unique value for this field; multiple objects were found

Database changes

No response

External dependencies

No response

Originally created by @thiagomarafeli on GitHub (Jan 30, 2024). ### NetBox version v3.7.1 ### Feature type Data model extension ### Proposed functionality When you try to bulk import Locations (e.g.) with a tenancy that is not unique, it prompts you an error saying that. But, it is allowed to create multiple Tenancies with the same name (and slug), but it has to be in different groups. So, it would be nice if I can specify the Tenancy group also, because, without that, I can't import it. ### Use case I have a tenancy group with name and slug "X" and "Y" I have a tenancy with name and slug "A" in group "X" I have a tenancy with name and slug "A" in group "Y" I have a tenancy with name and slug "A" in no group I want to import it, a Location that it is in tenancy "A", which is in group "Y", without any problems Nowadays, there's no "tenancy group" field option in import and, if you use "A" in Tenancy field, it raises: `Record 1 tenant: "A" is not unique value for this field; multiple objects were found` ### Database changes _No response_ ### External dependencies _No response_
adam closed this issue 2025-12-29 20:46:32 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 8, 2024):

If implemented, this should be done consistently for all models which support tenant assignment, ideally via the use of a mixin class which adds the tenant and tenant_group fields to each bulk import form.

@jeremystretch commented on GitHub (Mar 8, 2024): If implemented, this should be done consistently for all models which support tenant assignment, ideally via the use of a mixin class which adds the `tenant` and `tenant_group` fields to each bulk import form.
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

@arthanson commented on GitHub (Sep 19, 2024):

This is a bit more work to implement as tenant_group is not actually on any of the models, only tenant is, so this requires accessing the group through the tenant, tenant__group or such and that isn't currently supported anywhere in our CSV code.

@arthanson commented on GitHub (Sep 19, 2024): This is a bit more work to implement as tenant_group is not actually on any of the models, only tenant is, so this requires accessing the group through the tenant, tenant__group or such and that isn't currently supported anywhere in our CSV code.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 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 (Oct 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#9174