Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,328,565
Community Members
 
Community Events
168
Community Groups

Update Bitbucket Links for Migrated Tickets

The problem is pretty obvious;

  • We have several hundreds of tickets under a project ...
  • ... where some of them are already closed, some not yet started and some in progress ...
  • ... and we want to move these tickets under another project ...
  • ... which will break the links on Bitbucket PRs hence break the reverse links on Jira tickets.

It might be easy to simply update the PRs but since already merged PRs cannot be edited and they are already linked, what other options do we have to keep the links between Bitbucket and Jira?

1 answer

1 accepted

0 votes
Answer accepted
Andy Heinzer Atlassian Team May 10, 2021

Hi Kadir,

If I understand correctly, you want to move several Jira issues to a different project, but have concerns about how the development panel links from Bitbucket will be affected by  this change.

When you move an issue in Jira to a different project, Jira will maintain a redirect link of the old issue key so that it points to the new issue.  So if your issue had an issuekey of ABC-333 and you move it to a new project, let's say it has a new issuekey of NEW-456.  Anyone that attempts to reach the old issue key will get redirected to the current issue key instead.  The same is true for how these issues are linked from other development tools such as Bitbucket, github, etc.  That development panel in Jira will still maintain the commits/branches/pull request information from the old issue key.

However, this only continues to work as long as the original project key continues to exist.  If you plan to delete the original project or change the project key to something else, so that you can create/rename another project to have the old project key (ABC in my example), then those redirects of moved issues will be broken within Jira.

We also have a KB in regards to how Atlassian manages these issuekey references over in Migration of Jira's historical keys for issues and projects.  While this KB deals mostly in regards to how Jira is managing this from a Server to Cloud migration aspect, there is some important info about how such clashes are managed:

To put it simply, the resolution logic follows two simple rules:

  • The current (active) key wins over a historical one

  • Clashes between two historical keys are resolved in favour of the cloud version

 

Does this help? I'm not sure if you are planning to rename/delete the old projectkey here.  If you can avoid doing that, then moving issues to new projects should not pose a problem in regards to linking those issues back to their Bitbucket development info here.

Andy

Thank you for this detailed explanation @Andy Heinzer 

However, this only continues to work as long as the original project key continues to exist.  If you plan to delete the original project or change the project key to something else, so that you can create/rename another project to have the old project key (ABC in my example), then those redirects of moved issues will be broken within Jira.

Hi @Andy Heinzer . I've found myself in a situation where I've already deleted the original project and renamed the new project with the original key. Now the bitbucket links are referencing the incorrect issues as they've all been re-indexed,

Now that I've gotten into this predicament, is there a way to fix the bitbucket link associations? Thank you in advance!

Andy Heinzer Atlassian Team Jul 26, 2022

That is unfortunate.  It might be worth looking into restoring a backup of your Jira data if you have it.  In your case, there is not a clear undo or quick fix for this.  Those issues could be moved to a new project, but deleting the old project and renaming another project is known to cause the behavior you have seen here.  If you are in a server or data center edition of Jira, I'd recommend trying this first in a test environment.  If you're using Jira Cloud, again, a test environment is a far better place to test a change like this than in a production instance.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events