When you create a new branch using Jira and BitBucket, the branch name is automatically filled by BitBucket.
Today you can't change the naming convention: https://jira.atlassian.com/browse/JRASERVER-40549
This Tampermonkey script customize the default branch name to respect the following naming convention:
Template | Example | |
---|---|---|
Story or Task | features/<issue_code>/branch_name |
features/T2UI-52/tbar_rwd_without_adaptive_design |
Sub-task | subtasks/<parent_issue_code>/<subtask_code>/branch_name |
subtasks/T2UI-52/T2UI-112/tbar_logic_display (if the parent user story is T2UI-52) |
Sub-bug* | patches/<parent_issue_code>/<subbug_code>/branch_name |
patches/T2UI-52/T2UI-396/tbar_price_should_not_be_blue (if the parent user story is T2UI-52) |
Bug | patches/<issue_code>/branch_name |
patches/T2UI-49/price_should_be_right_aligned |
* Sub-bug is a custom issue type created to handle bugs found once the dev is done but before the story is merged.
As the parent issue code is not written in the URL, it's impossible to retrieve it automatically. So the script add the placeholder <parent_issue_code>
. It has to be replaced manually.
- Install in your browser the Tampermonkey extension : http://tampermonkey.net/
- Add in Tampermonkey the
customBranchName.js
script - Open the issue in Jira
- Click on the + Create branch button
- Thanks to the script, the branch name will be the good one. Just click on the Create branch button