Unable to add Assets object attribute due to "Name has to be unique" error
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When trying to add an attribute to an existing object in Jira, the user may get an error stating "Name has to be unique".
Environment
Jira Service Management with Jira Assets/Insight (any version).
Diagnosis
This has several potential causes listed below.
Cause
This error appears to be the case in one of the below circumstances:
- An existing attribute with that name already exists on the object directly.
- The parent of the object has inheritance turned on and another child object of that parent object has an attribute of that name
Solution
In the case of cause 1 above:
- Use the existing attribute already created on the object.
In the case of cause 2 above:
- If the object in question belongs to a parent object which has inheritance enabled, check all the children of that parent for any attributes with the same name and remove them. Please be considerate of any attribute data which may already exist, you will lose that data if you remove the attribute.