-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Medium
-
Affects Version/s: 10.3.9
-
Component/s: Assets - Jira Field & JQL
-
1
-
Severity 3 - Minor
Issue Summary
Assets fails to save an object due to a Unique constraint violation on an object reference attribute, incorrectly checking references across all attributes of the same target type.
Steps to Reproduce
- Create two Object Schemas, Object Type A (Parent) and Object Type B (Component).
- On Object Type A, create two separate Object Reference attributes:
- Attribute 1: References Object Type B. Enable the 'Unique' constraint.
- Attribute 2: References Object Type B. (Unique constraint is disabled).
- Create at least two Component objects in Object Type B (e.g., Component B-1 and Component B-2).
- Create a Parent Object A-1:
- Set Attribute 1 to reference Component B-1.
- Set Attribute 2 to reference Component B-2. (Save is successful)
- Attempt to create a second Parent Object A-2:
- Set Attribute 1 to reference Component B-2.
Expected Results
The operation should succeed. The 'Unique' constraint is only enabled for Attribute 1. Since Component B-2 is currently only used in Attribute 2 (which does not have the Unique constraint), it should be valid to reference it in the 'Unique' Attribute 1 of a different object (Object A-2).
Actual Results
The operation fails with a validation error, indicating the referenced object is not unique:
- Error Message in UI: "The attribute 'ABCD' has to be unique"
- The system incorrectly checks if the referenced object is used anywhere across all attributes pointing to Object Type B, rather than limiting the check to only Attribute 1.
The exception below is thrown in the "jira-application.log" file:http-nio-16602-exec-3 url: /jira/rest/insight/1.0/object/create; user: ABCD /rest/insight/1.0/object/create [c.r.j.p.i.services.validation.ValidateObjectImpl] Unique check: Existing object with id 283589 found with same value for object type attribute ObjectTypeAttributeBean [id=1716, name=ABCD, type=REFERENCED_OBJECT, defaultType=NONE]
Workaround
The only current workaround is to disable the 'Unique' constraint on the affected object reference attribute. But this is not consistent.
- links to