How to Fix Links in Wrong Direction After Cloning an Issue

Still need help?

The Atlassian Community is here for you.

Ask the community

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-24563 - Getting 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.

  1. Shut down JIRA;
  2. Run the following query in the JIRA database;

    PostgreSQL
    UPDATE 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);
    MySQL
    UPDATE 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);
    Oracle
    update 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));
    tip/resting Created with Sketch.

    Do not forget to commit your transaction!

  3. 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).

NameOutward DescriptionInward Description
Clonersclonesis cloned by

Last modified on Nov 16, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.