How to Fix Links in Wrong Direction After Cloning an Issue
Symptoms
Issues already cloned before JIRA 5.2.6 will stay with the clone information in the wrong direction, even after upgrading JIRA to version 5.2.6 or newer. However, new cloned issues will work properly after this upgrade.
Cause
Before JIRA 5.2.6, when cloning issues, the links were cloned in the wrong direction. After JIRA 5.2.6, the clone operation has regained its sense of direction and now creates links in the correct direction. See: - JRA-24563Getting issue details... STATUS .
Workaround
Perform the following query in order to change all the cloned links, it will change just the clones made before the upgrade.
Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.
- Shut down JIRA;
Run the following query in the JIRA database;
PostgreSQLUPDATE issuelink IL SET source = destination, destination = source FROM issuelinktype ILT, changegroup CG, upgradeversionhistory UVH WHERE IL.linktype = ILT.id and ILT.linkname = 'Cloners' and cast(UVH.targetbuild as int) >= 849 and CG.created < UVH.timeperformed and IL.source < IL.destination and (CG.issueid = IL.source or CG.issueid = IL.destination);
MySQLUPDATE issuelink IL, issuelinktype ILT, changegroup CG, upgradeversionhistory UVH SET IL.source = IL.destination, IL.destination = IL.source WHERE IL.linktype = ILT.id AND ILT.linkname = 'Cloners' AND UVH.targetbuild >= 849 AND CG.created < UVH.timeperformed AND IL.source < IL.destination AND (CG.issueid = IL.source OR CG.issueid = IL.destination);
Oracleupdate issuelink ILU set ILU.source=ILU.destination,ILU.destination=ILU.source where ILU.id in (select IL.id from issuelink IL, issuelinktype ILT, changegroup CG, upgradeversionhistory UVH where IL.linktype = ILT.id AND ILT.linkname = 'Cloners' AND UVH.targetbuild >= 849 AND CG.created < UVH.timeperformed AND IL.source < IL.destination AND (CG.issueid = IL.source OR CG.issueid = IL.destination));
Do not forget to commit your transaction!
- Restart JIRA and verify if everything is correct.
If you've previously changed the Outward and Inward direction of the Issue Link, change it back to the default (see below).
Name | Outward Description | Inward Description |
---|---|---|
Cloners | clones | is cloned by |