Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Commit linked to wrong project

Max
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 9, 2018

Our Jira account has a few projects, and linked to our Bitbucket account. Up until recently we have been using the Smart Commit feature flawlessly. However, recently we opened a new Jira project with a new project key (e.g. XZY), and for unknown reason, some of our previous commits with an old project key (e.g. XAB) appeared as commits in the XZY project. 

While the project keys between the ticket and commit do not match, their ticket numbers do. For instance, XZY-30 ticket shows it has X commits with the smart commit key "XAB-30".

Does anyone know why this is happening and how we can fix it?

1 answer

1 vote
Andy Heinzer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2018

I think I understand what has caused this behavior.  It is likely that the project key in Jira has changed for this project from XAB -> XZY.  This would explain why the issue numbers are the same, but the project key appears differently.   One of the other side-effects of editing an existing project's key is that Jira leaves behind a pointer reference from the old key to point at the new key.

The same thing happens when you move an issue to a new project.   It is still possible for you to try to access the old key of the issue directly and get redirected to the new issue.  Try that first to confirm this suspicion, try going to your JIRAURL /browse/XAB-30

If my assumption is correct when you press enter in the address bar of your browser, the site will automatically redirect you to JIRAURL /browse/XZY-30

This behavior is explained in more detail in Editing a project's details.  I believe this is happening by design, in order to help other applications, users, and integrations still be able to find these issues after an issue move or project key change.

 

One way to correct this would be first export all the issues in this project, then delete the project from Jira.  That way you can then recreate the project XZY fresh and import these issues again into this project.   The imported issues won't have this previous redirect record because the project was deleted.  But there is potentially other data that would be lost as a result of deleting the entire project (ie workflows associations would be lost, project configuration settings lost, it's also possible attachments in these projects would be lost.   Not a great solution for everyone that comes across this problem admittedly, but it does have the potential to prevent this redirect.   But even I am hesitant to suggest this avenue given the nature of data loss you could potentially incur.   It would be better to test this in a staging environment if possible first.

If you were on Jira Server, I would recommend taking a closer look into the Jira database, specifically the moved_issue_key table.  This holds these redirect references.  However since you are on Cloud, you don't have any access to the Jira database to do this.  It might be helpful to open a support case with our cloud support team directly to seek additional help in this case.  Perhaps they can take a closer look at your situation and offer you assistance here or other alternatives to follow to correct this.  

Max
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 10, 2018

Hi Andrew, it's exactly as you suspected, and more!

Upon investigating audit log, I realized the XAB project which I thought was just obsolete, was actually DELETED, together with hundreds if not more tickets with it. A new project was created with the same key "XAB" then later changed to "XZY". 

I'll contact the support team and see if they can remove the old reference key...

Thank you for your help. I want to share with you the peculiar feeling of experiencing such things first hand at work, but I lack the words to describe it.

Suggest an answer

Log in or Sign up to answer