Forums

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

Bitbucket connects to wrong Jira site

Kevin Brown February 25, 2019

I have a Bitbucket account and also have access to two Jira sites, a test Jira site and a production Jira site.

The Bitbucket / Jira integration worked well with the test Jira site. But when attempting Bitbucket / Jira integration with the production Jira site, the connection process still attempts to connect the test Jira site.

I have tried it both ways, (1) connecting Bitbucket to Jira:
https://confluence.atlassian.com/bitbucket/connect-bitbucket-cloud-to-jira-software-cloud-814190686.html
and (2) connecting Jira to Bitbucket:
https://confluence.atlassian.com/adminjiracloud/connect-jira-cloud-to-bitbucket-cloud-814188428.html

When attempting direction (1), I install the "Jira" app and proceed through screens at bitbucket.org and the _production_ Jira site. But when I click on "Grant access" the _test_ Jira site gets connected instead. There are no error messages. It just connects to the wrong Jira site. (When I list the commits for my Bitbucket repository, all the Jira issue links point to the wrong Jira site.)

When attempting direction (2), the connection fails rather than silently connecting to the wrong Jira site. (That apparently got complicated when I changed my Bitbucket username a week or two ago.) I eventually reach a panel at the _production_ Jira site page that has a button "Integrate with Bitbucket". Clicking on that button shows a bitbucket.org page that displays my current Bitbucket account name and also says that JIRA (at the _production_ URL) is requesting access. At that point everything looks OK. But when I click on "Grant access" it somehow switches to the _test_ Jira site and fails because it is trying to use my old Bitbucket account name. ("Invalid credentials, please create the connection again")

How can I untangle this mess? For example, should I delete my account at the _test_ Jira site and hope that it does not also delete my access to the _production_ Jira site? Thanks.

2 answers

0 votes
Kevin Brown February 28, 2019

Atlassian support gave me a tip that pointed me in the right direction; a Bitbucket account can link to only one Jira instance.

But fixing the problem required one more trick. I had to hand-edit the URL for my account:
    https://bitbucket.org/account/user/myusername/addon-directory/
to reach the one for the company account:
    https://bitbucket.org/account/user/companyname/addon-directory/
and see that the company account still had a Bitbucket connection to the _test_ Jira site. Then I was able to delete that connection and add a connection to the _production_ Jira site. Now the Jira/Bitbucket integration is working for the _production_ Jira site.

Marty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 2019

I'm glad you were able to get to the bottom of it!

Tran Tien dung
Contributor
March 2, 2020

Hi @Kevin Brown 

I got the same issue and tried your solution, but when I access the url https://bitbucket.org/account/user/companyname/addon-directory/, this is a Marketplace page and I did not see a Bitbucket connection to the test jira site, please advise me how to check it.

I'm using Bitbcuket cloud and Jira software.

Thanks.

Kevin Brown March 2, 2020

Hi @tiendungitd

I just tried accessing the page of the form:

    https://bitbucket.org/account/user/companyname/addon-directory/

which redirects to a slightly different URL of the form:

   https://bitbucket.org/account/user/companyname/addon-directory/?detectloginloop

That page shows the App Marketplace, which sounds similar to what you encountered. Then I hand-edited the URL to:

   https://bitbucket.org/account/user/companyname/addon-management

and reached a page that showed only the _installed_ apps for companyname, which looks like an improvement, but still looks insufficient for resolving the issue since I am not able to edit the settings for the "Jira" installed app.

Maybe the Atlassian cloud software has changed in the past year? Or maybe it is just that the admins at my company have changed their settings so that I no longer am able to do what I did last year. This may require the assistance of Atlassian support to resolve your issue. Good luck.

Kevin Brown March 2, 2020

Hi @Tran Tien Dung

I just tried accessing the page of the form:

    https://bitbucket.org/account/user/companyname/addon-directory/

which redirects to a slightly different URL of the form:

   https://bitbucket.org/account/user/companyname/addon-directory/?detectloginloop

That page shows the App Marketplace, which sounds similar to what you encountered. Then I hand-edited the URL to:

   https://bitbucket.org/account/user/companyname/addon-management

and reached a page that showed only the _installed_ apps for companyname, which looks like an improvement, but still looks insufficient for resolving the issue since I am not able to edit the settings for the "Jira" installed app.

Maybe the Atlassian cloud software has changed in the past year? Or maybe it is just that the admins at my company have changed their settings so that I no longer am able to do what I did last year. This may require the assistance of Atlassian support to resolve your issue. Good luck.

Kevin Brown March 2, 2020

Hi @tiendungitd

I just tried accessing the page of the form:

https://bitbucket.org/account/user/companyname/addon-directory/

which redirects to a slightly different URL of the form:

https://bitbucket.org/account/user/companyname/addon-directory/?detectloginloop

That page shows the App Marketplace, which sounds similar to what you encountered. Then I hand-edited the URL to:

https://bitbucket.org/account/user/companyname/addon-management

and reached a page that showed only the _installed_ apps for companyname, which looks like an improvement, but still looks insufficient for resolving the issue since I am not able to edit the settings for the "Jira" installed app.

Maybe the Atlassian cloud software has changed in the past year? Or maybe it is just that the admins at my company have changed their settings so that I no longer am able to do what I did last year. This may require the assistance of Atlassian support to resolve your issue. Good luck.

0 votes
Marty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 25, 2019

Hi Kevin,

I am not on the Jira or Bitbucket teams but I will try to help.

I'd recommend that you try to remove the connection between your Test Jira instance and Bitbucket.

If you go to Jira Settings > Applications > DVCS accounts -> Visit account -> Delete

I hope that helps!

Kevin Brown February 26, 2019

Hi Martyn,

Thanks for your quick suggestion. That gave me some more clues although not yet a complete solution.

First, even though I have some sort of admin access, from Jira Settings I do not see an "Applications" menu item, so I may not have sufficiently high admin access. But I can go directly to a "DVCS" page:
https://(subdomain).atlassian.net/secure/admin/ConfigureDvcsOrganizations!default.jspa
where "(subdomain)" is the company account name.

Second, to start cleanly, I removed all existing connections. (There were two shortcuts under a project at the production Jira site and none for the test Jira site. Then at bitbucket.org I removed the existing connection to Jira.) At that point I was unable to add a connection to Jira from Bitbucket. The textbox that asks for the Bitbucket repository name cannot find any matches, apparently because the Bitbucket repository is in the same team but I am not the owner. Unfortunately, when I click on the "Change user" link, it will not let me change to that other user who is listed in the dropdown list.

It looks like I will need the assistance of the _super_ admin for the production Jira site to remove a reference to my old Bitbucket username that somehow remains. Then when attempting to connect from Bitbucket to Jira I may need an ability to switch to the user on my team who owns the Bitbucket repository, even though that was not necessary when linking from the test Jira site.

Like # people like this
Marty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2019

Wow.

Sounds like the setup on your Production Jira site is more "locked-down" than your test Jira site ¯\_()_/¯

Good luck!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events