It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Automatic branch creation on bitbucket

i can manually create a branch on jira using same issue name. but i need to automatically create branch on bitbucket using the same issue name jira. can anyone help me this .

Thanks in advance.

1 answer

1 accepted

0 votes
Answer accepted

HI @sunisgcet 

To automate the branch creation in bitbucket you need to work with workflow triggers.

Please have a look at the below Atlassian article for details.

https://confluence.atlassian.com/adminjiracloud/configuring-workflow-triggers-776636696.html

Hi @Yogesh Mude Thanks for ur response. I will refer this site.

hi @Yogesh Mude i tried commit created trigger it works but in that  how can i execute branch created trigger. in which transition i can use that branch created trigger and how can i configure it. if you know any reference links means please let me know.

Thanks in advance.

HI @sunisgcet 

For example, let say...you have the sample workflow like...ToDo --> In Progress --> Done

Whenever the user will transit the ticket (click on Start progress transition button) from ToDo to In Progress then automatically the brach should create in Bitbucket, for this, you need to add workflow triggers on start progress transition.

Like sunisgcet likes this

Once again Thank you @Yogesh Mude .as per you mentioned above i did.but in bitbucket there is only default master branch showing. if i locally made a commit using my issue key it shows commit history but not showing branch ..how can i verify branch should created .here i attached my snap.  

HI @sunisgcet 

Sorry, its muy mistake, actually it's not like that you want.

If you added the branch create trigger into start progress workflow transition then whenever a user will create a branch manually in bitbucet then the issue will auto transit from ToDO to In Progress. 

Like sunisgcet likes this

HI @Yogesh Mude but i need to create automatic branch creation..how can i do this .i am confused 😕, then why we used branch created trigger on jira workflow.?

@Yogesh Mude i read that previous discussion if any examples link or videos  means it will be useful for me.

Hi @Yogesh Mude Member  i just tried one method. i created one jira project inside that project i created one issue then i add the workflow for my project  in that workflow i added trigger (branch created , commit created) and then i go with my bitbucket existing which i created before , in that repo i do some commit codes from local to remote  while doing this i commit with my jira issue key id .git commit -m "jira issue key initial commit " and then i add to remote using command "git remote add jira issue key my repo url".defaulty there is a master branch available in bitbucket first time we push any codes into bitbucket. then i checked branch using command "git branch -a" , it showed master branch only . then i created a new branch with my jira issue key using command  git checkout -b jira issue key", it created new branch and switched to new branch wat i created with my jira issue key. then i push this branch into remote  using command "git push issue key issue key", then i refreshed my jira and bitbucket and checked it there is new branch created on the jira & bitbucket with the same name of my jira issue key. if i  doesnt commit without my jira issue name on the jira my issue UI  it doesnt show any changes .

i dont know it is right or wrong  but these are i did manually on the bitbucket with my iisue key. i think this is differ from automatic branch creation per issue. because i execute commands manually on the bitbucket. i just sharing this to you what i tried  .

i know it is bit complex to read this comment, Thanks .

HI @sunisgcet , Its Okay.

Yeah, agreed, unless until you provide the Jira issue key while committing your changes won't reflect that respective Jira issue and its called smart committing, so please follow the best practices.

You can find details information here.

Yup @Yogesh Mude Thanks for replied .. i ll look to the smart commits.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

880 views 7 24
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you