How to link sourcetree feature branch to a Jira issue/Task??
Asked by Wang_ Qiang:

Dear friends:

I met a problem, I have craeted a feature branch called a_test_branch_1234 in BitBucket in Remote Repo, I hope to create an issue called task_1234 and subtask called subtask_5678 in Jira and hope this feature branch a_test_branch_1234 can link to this task and subtask,  
And I have created task_1234 and subtask_5678 already, looks like I cannot link them together,  
really hope guru here throw some lights to guide me how to to it?  
My way so far is on the right track or not?

Please give some advise.

Thanks  
Charlie


Answers:
author: Mikael Sandberg
body: The way you link a Jira issue to a branch in Bitbucket is to include the issue key, for example JRA-123, as part of the branch name. Note that the key has to be first in the branch name like this, JRA-123-My-branch.

comments: author: Wang_ Qiang
body: Good morning, Mikael!  
Thanks for advice.  
You mean to associate a Jira task is :  
1. Create an issue in Jira first like JRA-123, then get this Jira issue key JRA-123  
2. Then create a BitBucket feature/release branch and in the subject to include this Jira issue key JRA-123 in remote Repo.  

That is correct creation order, right?  
instead of reverse, correct?

and subtask is same order, right??

<br />

I think I did wrongly. I created branch 1st, not include   

Thanks so much  

Charlie  


author: Mikael Sandberg
body: Correct, and you can create the branch directly from Jira once you created the issue. You should see a Development section on the right-hand side, and from here you can create a branch, and Bitbucket will then suggest the name of the branch for you, consisting of the issue key and the summary field.


author: Wang_ Qiang
body: Thanks so much,

"you can create the branch directly from Jira once you created the issue. You should see a Development section on the right-hand side, and from here you can create a branch, and Bitbucket will then suggest the name of the branch for you, consisting of the issue key and the summary field."  

I am looking for this **Development section on the right-hand side** for long time, I did not see it,   

Do I need to open this issue I created to enter into issue to see this "**Development section on the right-hand side**"?

See picture attached  
Maybe we are not on the same page?

I am in wrong place?

Curious there is this "**Development section on the right-hand side** " or panel?  

Thanks again  

Charlie


author: Mikael Sandberg
body: In order to create the branch directly from within Jira you have to link your project to your Bitbucket. Have a look at [Connect Jira Cloud to Bitbucket](https://support.atlassian.com/jira-cloud-administration/docs/connect-jira-cloud-to-bitbucket/) for more information.


author: Wang_ Qiang
body: Thanks,  
I follow your instruction,   
Create an issue named Jira_123 in Jira, then create a branch started with Jira_123, it looks like Jira_123_test456;

<br />

then Update code, push again, I got this error:

<br />

XXXXXX: JIRA Issue does not exist  
remote:  
remote: In order to commit, your JIRA must be "In Development".  
remote:

I check Jira again,

Its status is in development, pls see attached picture..  

thank


author: Wang_ Qiang
body: ![InDev.png](https://community.atlassian.com/t5/image/serverpage/image-id/173952iF1B4B4171BDB0463/image-size/large?v=v2&px=999 "InDev.png")


author: Mikael Sandberg
body: You have to check how your hook is setup in Bitbucket, it might be that it also triggers on commit comments, so you would have to make sure any issues mentioned in the comment are in the correct status.


author: Wang_ Qiang
body: Good morning, Michael:  
I got successful push, I fix the issue.

Thanks a lot.


author: Wang_ Qiang
body: Also Looks like this "Development section" is located in lower part of issue, named Activity, in Activity section, there is a **sub_section** called **source tab within Activity section**, open source tab, on the right side of source tab, there is a development section,; and on the left side of source tab, there is an admin section.

So If I want to see this source tab, I need admin privilege, right?

Is this correct??  
If yes, I have no admin section, also I have no **source tab within Activity section** ,  

Thanks