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.