The first step is to create a new consumer in Bitbucket Cloud for Jira, which will generate the consumer key and secret:
- Log in to your Bitbucket account.
- Navigate to Bitbucket settings > OAuth.
- Click on the Add consumer button under OAuth consumers.
- Enter a name for the new OAuth consumer. The name you enter here will be displayed when Jira requests access authorization, so you should use a name that is easily understandable, such as Atlassian Jira.
- Click on Save. This will generate the consumer details we need for the next step:
Once we have created the new consumer, the next step is to enter the consumer key and secret details into Jira, as follows:
- Navigate to Administration > Applications > DVCS Accounts.
- Click on the Link Bitbucket Cloud or GitHub account button.
- Select Bitbucket Cloud as the Host option.
- Enter the Bitbucket account name, the OAuth Key, and the OAuth Secret details that are generated from the consumer we just created:
- Click on Add to link Jira to Bitbucket Cloud.
Once Jira has established a connection to Bitbucket Cloud, you will be prompted to grant Jira access to your Bitbucket Cloud account. Make sure the consumer name (in bold) is the same as the consumer we created, and then click on Grant access:
Let's understand how these steps work.