-
Bug
-
Resolution: Fixed
-
Low (View bug fix roadmap)
-
5.2.4, 5.2.9
-
5.02
-
NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.
Summary
If a clone operation fails during the create transition (such as when a validator on the Create transition stops the issue creation), JIRA adds a self-referencing link to the original issue (only if the Cloners link type is specified, of course).
Steps to Reproduce
- Create a validator such as Required Field(s) using JIRA Suite Utilities on the Create Issue Transition.
- Setup an issue so that it does not have those requirements. For example, set the requirement to affects version, then remove the affects version from the issue.
- Attempt to clone the issue.
Expected Results
The issue does not create a clone and notifies the user why.
Actual Results
The issue is not cloned, however an issue link is created to itself. Nothing notifies the user of failure.
Workaround
Fix the validator for that issue and then clone it. Using the above example that would mean adding an affects version.
Notes
After some investigation, this appears to be caused by the following code in the doExecute() method of the CloneIssueDetails class:
// Create link between the cloned issue and the original - sequence on links does not matter. final IssueLinkType cloneIssueLinkType = getCloneIssueLinkType(); if (cloneIssueLinkType != null) { issueLinkManager.createIssueLink(getOriginalIssue().getId(), getIssue().getLong("id"), cloneIssueLinkType.getLong("id"), null, getLoggedInUser()); }
By simply calling the getOriginalIssue() and getIssue() methods, there is a built-in assumption that the clone creation succeeded. However, if the creation failed, these two methods will return the same issue (originalIssue is first set using the getIssue() result).
Please add a check here that the clone creation actually succeeded, or at least that getOriginalIssue() and getIssue() are resulting in different and valid issues.
- is duplicated by
-
JRASERVER-28003 No error report and erroneous actions when unable to create clone issue
-
- Closed
-
-
JRASERVER-30454 Issue will be cloned back to itself if validator is not fulfilled
-
- Closed
-
-
JRASERVER-31189 Cloning leaves issue with two strange self referencing issue links when validator in "Create" transition fails
-
- Closed
-
- relates to
-
JRASERVER-23883 Validators used with Subtasks, when cloning the parent issues, causes inconsistencies
-
- Closed
-
-
JRACLOUD-29704 When clone operation fails during create, a self-referencing cloners link is added to the original issue
-
- Closed
-
- Testing discovered
-
JRASERVER-41092 When clone operation on subtask by parent issue fails at create transition, there is no reaction to user
-
- Gathering Impact
-
- causes
-
ADM-43702 Loading...
When clone operation fails during create, a self-referencing cloners link is added to the original issue
-
Bug
-
Resolution: Fixed
-
Low
-
5.2.4, 5.2.9
-
5.02
-
NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.
Summary
If a clone operation fails during the create transition (such as when a validator on the Create transition stops the issue creation), JIRA adds a self-referencing link to the original issue (only if the Cloners link type is specified, of course).
Steps to Reproduce
- Create a validator such as Required Field(s) using JIRA Suite Utilities on the Create Issue Transition.
- Setup an issue so that it does not have those requirements. For example, set the requirement to affects version, then remove the affects version from the issue.
- Attempt to clone the issue.
Expected Results
The issue does not create a clone and notifies the user why.
Actual Results
The issue is not cloned, however an issue link is created to itself. Nothing notifies the user of failure.
Workaround
Fix the validator for that issue and then clone it. Using the above example that would mean adding an affects version.
Notes
After some investigation, this appears to be caused by the following code in the doExecute() method of the CloneIssueDetails class:
// Create link between the cloned issue and the original - sequence on links does not matter. final IssueLinkType cloneIssueLinkType = getCloneIssueLinkType(); if (cloneIssueLinkType != null) { issueLinkManager.createIssueLink(getOriginalIssue().getId(), getIssue().getLong("id"), cloneIssueLinkType.getLong("id"), null, getLoggedInUser()); }
By simply calling the getOriginalIssue() and getIssue() methods, there is a built-in assumption that the clone creation succeeded. However, if the creation failed, these two methods will return the same issue (originalIssue is first set using the getIssue() result).
Please add a check here that the clone creation actually succeeded, or at least that getOriginalIssue() and getIssue() are resulting in different and valid issues.
- is duplicated by
-
JRASERVER-28003 No error report and erroneous actions when unable to create clone issue
-
- Closed
-
-
JRASERVER-30454 Issue will be cloned back to itself if validator is not fulfilled
-
- Closed
-
-
JRASERVER-31189 Cloning leaves issue with two strange self referencing issue links when validator in "Create" transition fails
-
- Closed
-
- relates to
-
JRASERVER-23883 Validators used with Subtasks, when cloning the parent issues, causes inconsistencies
-
- Closed
-
-
JRACLOUD-29704 When clone operation fails during create, a self-referencing cloners link is added to the original issue
-
- Closed
-
- Testing discovered
-
JRASERVER-41092 When clone operation on subtask by parent issue fails at create transition, there is no reaction to user
-
- Gathering Impact
-
- causes
-
ADM-43702 Loading...