Bitbucket and Jira deployment linking
Asked by Dustin Carl:

I'm trying to figure out how Bitbucket deployments get linked in Jira.

We have a project with multiple repos (call it FE and BE) - we are a small team, so we have one JIRA project representing both repos (call it PRJ).

A developer today fixed multiple small things in a single branch. So the structure looked like this:

**Branch Name**: PRJ-01 fixes

* Commit 1: PRJ-01 fix thing
* Commit 2: PRJ-02 fix thing
* Commit 3: PRJ-02 PRJ-03 fix multiple things

These were then put up for PR in a single PR into main (our prod branch).

I merged the PR and deployed the branch, but only PRJ-01 is showing a deployment.

The 'diff' when I deploy though showed all the linked issues correctly (also a way to export these would be great).


Answers:
author: Theodora Boudale
body: Hi Dustin Carl and welcome to the community!

Can you please clarify where exactly the deployment is missing? Is it when you open a certain Jira ticket (for PRJ-02 and PRJ-03), then open the Development panel for this ticket and select the Deployments tab?

Kind regards,  
Theodora

comments: author: Dustin Carl
body: Yep, thats exactly where. I see the commits, builds, and PR's but I do not see the deployment.


author: Theodora Boudale
body: Hi,

I am not able to reproduce the issue you are reporting. Could you please provide some additional details to ensure I am reproducing it with a use case similar to yours?  

1. Does the Pipelines build with the deployment to production run on a **branches** definition, on a **pull-requests** definition, the **default** definition, or is it a **custom** pipeline?  

2. If the build runs on a **branches** definition, is it for the main branch?  

3. If you trigger the build manually (e.g. in case of a **custom** pipeline), which branch are you running it for?  

4. When you merge the PR from **PRJ-01 fixes** to the**main** branch**,** do you use a**merge commit, fast-forward,** or **squash** merge strategy?  

5. Is Commit 1 the last commit of the branch? Or is the last commit Commit 3?

Kind regards,  
Theodora


author: Dustin Carl
body: For sure!

- Branch definition for **main**

- Not the 'main' branch as defined in bitbucket (that's dev), but it is the 'production'' branch

- I can't remember if it was a manual run or not, but it would have been for main

- PRJ-01 was the last commit of the branch. If you take a look at the attached screenshot, only FLS-458 was picked up as deployed.

Very much appreciate you taking the time to help us out! :)

![Screenshot 2024-06-05 at 7.18.17?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/328094i50FF0AA7B31DAD7C/image-size/large?v=v2&px=999 "Screenshot 2024-06-05 at 7.18.17?AM.png")


author: Theodora Boudale
body: Thank you for the info, [@Dustin Carl](/t5/user/viewprofilepage/user-id/791936), I'm happy to help!  

1. Can you also please let me know what merge strategy you used to merge the PR from **PRJ-01 fixes** into the destination branch? Did you use merge commit, fast-forward, or squash merge strategy?  

2. Just to make sure, the build ran for the ++destination branch++ of the PR, and not for the branch **PRJ-01 fixes**, is that correct?

For a faster resolution, I recommend creating a ticket with the support team for investigation. If we have an open support ticket, the engineer working on it will be able to access the deployment and the pull request and understand much quicker what has happened. I cannot access your repo without a support ticket, so the best I can do is try to reproduce based on the info you provide.

You can create a ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. When you are asked to provide the workspace URL, please make sure you enter the URL of the workspace that is on a paid billing plan to proceed with ticket creation.

Otherwise, please let me know about the merge strategy and whether the build ran for the destination branch so I can try reproducing this.

Kind regards,  
Theodora


author: Dustin Carl
body: It was just a regular merge commit.

Weirdly though - we had a deployment this morning and everything linked up perfectly!

If it happens again I will open a support ticket.

Thanks for the help Theodora, appreciate it!


author: Theodora Boudale
body: Thank you for the update! It's good to hear that the next deployment worked as expected!

I'm afraid that I haven't been able to reproduce this with a setup similar to yours and a PR that is merged with a merge commit.

Please feel free to open a support ticket if it ever occurs again, or if you want us to investigate what happened with that specific deployment.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

deployments