change default branch name in jira

todesco September 17, 2013

We have integrated JIRA ondemand with bitbucket and love the fact that you can create a new feature branch from an issue. What we'd like is to change the default value of the branch name field to something lite "feature/<issue-key><issuename>".

Couldn't find an option to do that. Is it possible?

Br

Joakim

13 answers

1 accepted

3 votes
Answer accepted
Justen Stepka [Atlassian] September 23, 2013

Hi there, this is an error on our part.

The branch types attribute is only available for Stash when using the new Create Branch feature that is supported by Bitbucket. Inside of JIRA we currently have a general 'What's new' page that is the same for behind the firewall and OnDemand.

I'll check with our JIRA team to see if we can get this fixed, sorry for any confusion this has caused.

Cheers, Justen -- Bitbucket product manager

Chris Knight August 19, 2014

Is there an update for this? Been almost a year now. If this has been done can you point me to where the documentation is as I can't seem to get this working.

danielsheard November 17, 2015

Now 2 years! This is a basic change and very critical to improving the efficiency of the tools

guisim March 4, 2016

I'd love to have some flexibility regarding the branch names in Bitbucket. Any updates?

Shea Martin September 22, 2016

Update?

Ádám Zovits August 15, 2017

An implementation would be a nice way to celebrate the 4th anniversary of this feature request :)

Ádám Zovits September 14, 2018

Or maybe the fifth then :D

Anatoliy Mushtuk December 3, 2018

Please, implement configurable branch name prefix! Such a simple feature would bring a good value for our team.

Abdul September 5, 2019

almost 2020.

Soheil_Hasankhani March 28, 2020

2020 :|

Bernd Eckstein April 7, 2020

I was just searching for this feature, as i was advising a team how to use bitbucket with jira and git flow ... and guess what: they ALL forget to select the feature/ prefix.

I would LOVE to select a default branch type based on the jiira issue type.

Noah Fernandes April 9, 2020

How the *beep* is this still an issue 7 years later?! C'mon Jira, what the *beep'* is taking so long?

Aleksey Khokhlov March 21, 2021

2021 Maybe in this year?

Like Phil Rittenhouse likes this
8 votes
todesco September 23, 2013

To follow up on my own question. In the "What's new in JIRA 6.1" dialog that pops up when you enter ondemand there seems to have been added an option "branch type" which would solve my problem. But we don't get that option in our system. Is this not rolled out yet or do we have to configure it?

Ian Molee October 24, 2016

We'd love to see this as well. Our default branch naming scheme includes the year and month the branch was cut.

4 votes
Jason Allen February 22, 2017

Hello

Hopefully this will be of use to some people. I am a fan of Tampermonkey scripts to tamper with websites to do what I want. In a need for this feature I have implemented this short script:

 

// ==UserScript==
// @name         Bitbucket: Better branch name
// @namespace    https://www.playitsoftware.com
// @version      1.0
// @author       You
// @match        https://bitbucket.org/branch/create*
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';
    var issueType = (window.location.href.match(/&amp;issueType=([^&amp;]+)&amp;/) || [])[1];
    
    var prefix = '';
    switch(issueType)
    {
        case 'Bug': prefix = 'fix/'; break;
        default: prefix = 'feature/'; break;
    }
    
    $('#id_branch_name').val(prefix + $('#id_branch_name').val()).trigger('change');
})();

 

It pulls the issueType from the href and prepends the appropriate prefix to the branch name. Feel free to tweak for our own prefixing needs.

Jason

Benedict Roeser July 25, 2018

Hey Jason,

This is in fact extremely useful! Thank you!

tomharto August 8, 2018

Awesome, thanks!

Benedict Roeser October 5, 2018

Today, this stopped working for me. Seems that Bitbucket removed the id from the form field and accessing it via name also doesn't seem to work. :(

4 votes
Shea Martin September 22, 2016

+1 for this. We like to have the user's name in the branch:

myname/PR-123-feature-number-one-two-three

It would be nice if you Let the user build their branch names with the following variables:

  • Issue Type (bug/feature/etc)
  • Epic Name
  • Username
  • Issue Number
  • Issue Description

Thus currently the setting would be ${Issue Number}-${Issue Description}, and I would be able to accomplish what I want with ${Username}/${Issue Number}-${Issue Description}.

I think that would solve it for pretty much everyone here.

 

Abdul September 5, 2019

my team needs this for sure.

2 votes
Phil Rittenhouse January 27, 2017

+1 for us too

By the way, everyone should check out the feature request here: https://jira.atlassian.com/browse/BSERV-8746 and upvote

1 vote
Deleted user November 21, 2016

+1

1 vote
Fraser Hardy August 18, 2014

I +1 for this to be supported in Bitbucket too. We use git-flow and the missing branch type with Jira and Bitbucket is stopping us from using in-Jira branching.

1 vote
Jeremy Weathers March 4, 2014

We are also looking for this functionality with download JIRA (6.2) and Bitbucket. The branch type should be based on the issue type, so if I create a branch from a new feature or enhancement issue, the branch name would be e.g. feature/ABC-123, but if I create from a bug issue, then the branch name would be e.g. bugfix/ABC-456.

0 votes
da61 August 13, 2019

+1 our team could really use this feature

0 votes
Anatoliy Mushtuk December 3, 2018

+1 for configurable branch name prefix feature implementation

0 votes
Kim Carlsen September 16, 2015

any update?

0 votes
Lucas Conde July 22, 2015

How can I do that? Can´t find any documentation.

0 votes
Michael Feher November 3, 2014

@Fraser Hardy A workaround for using the git/hg-flow extensions is to prefix the auto generated branch name with feature/ and your flow commands should work as expected. Cheers!

Suggest an answer

Log in or Sign up to answer