Skip to main content

Takes a JIRA issue and creates a git branch

Project description

JIRA 2 Branch

Takes a JIRA issue and creates a git branch

Usage: jira2branch [OPTIONS] ISSUE_ID_OR_URL SOURCE_BRANCH

  Simple program that takes a JIRA issue ID and creates a new local and
  tracking remote branch

Options:
  -s, --simple                  Basic naming strategy
  -n, --name-only               Generates the branch name and prints it, no
                                actual branch will be created (default is
                                False)
  --include-issue-type BOOLEAN  Set to false to exclude JIRA issue type (e.g.:
                                feat) from naming (default is True)
  --branch-name-prefix TEXT     Branch name prefix
  --branch-name-lowercase       Always convert branch name to lower case
  -p, --push                    Push newly created branch to remote (default
                                is False)
  -t, --target PATH             Target repository (default is current
                                directory)
  -r, --merge-request           Create merge request. Requires --push.
                                (default is False)
  -c, --confirm                 Request user confirmation (default is False)
  --preview                     Preview MR Markdown in browser (default is
                                False)
  -d, --dry-run                 Dry run. Prints out the MR payload in JSON
                                format but does not invoke the API
  --config                      Show config file location
  --help                        Show this message and exit.

Naming strategy

Default naming strategy

Format: {CONVENTIONAL_COMMIT_PREFIX}/{ISSUE_ID}_{ISSUE_TITLE}

The conventional commit prefix is inferred from the type of JIRA card.

$ jira2branch ISSUE-10306 master -n

BRANCH NAME: #############################################
feat/ISSUE-10306_implement_foo_function
##########################################################

MR TITLE: ###################################################
feat/ISSUE-10306: Implement foo function
#############################################################

Basic naming strategy format

Format: {ISSUE_ID}

Example:

$ jira2branch ISSUE-10306 master -s -n

BRANCH NAME: 
ISSUE-10306
##########

MR TITLE: ##############################################
ISSUE-10306: Implement foo function
########################################################

Requirements

Requires Python 3.11

Dev env

pip install poetry
poetry install
pip install dist/jira2branch-[VERSION]-py3-none-any.whl

Afterwards, your command should be available:

$ jira2branch WT3-227 develop
fix/WT3-227_some-jira-issue

Configuration

JIRA

JIRA credentials will be fetched from jira2branch/config.toml under your user config directory with the following format:

[jira-credentials]

url = ""
email = ""
username = ""
password = ""
token = ""

Required fields

url and email are required.

Use either username + password or token depending on how access is configured

GitLab integration

You can create merge requests (title and description) using this tool. Only GitLab is supported for now and it requires the following setup step.

Once done providing --merge-request will launch your $EDITOR and let you compose your merge request.

[gitlab-credentials]

url = ""
token = ""

Required fields

token is required

Set url if the GitLab instance you're using is self-hosted

Note

You can always retrieve the configuration file location by providing the --config flag

Usage

jira2branch [JIRA_ISSUE_ID|JIRA_ISSUE_URL] [TARGET_BRANCH]

Examples

jira2branch WT3-227 main

jira2branch https://company.atlassian.net/browse/WT3-227 main

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jira2branch-0.9.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jira2branch-0.9.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file jira2branch-0.9.0.tar.gz.

File metadata

  • Download URL: jira2branch-0.9.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Darwin/25.2.0

File hashes

Hashes for jira2branch-0.9.0.tar.gz
Algorithm Hash digest
SHA256 37c45145784d6660492e9fc679416052ae7b15c19c8ecba34f50918b0044cf8e
MD5 44015800123e880edce71c1d00a7ed75
BLAKE2b-256 4fe430ccf6a00f05dd638326da9962688b3cb849f9ff2eced7ccb551e12cc6c0

See more details on using hashes here.

File details

Details for the file jira2branch-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: jira2branch-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Darwin/25.2.0

File hashes

Hashes for jira2branch-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86ba13cf86f75796d8719fb93b7085c102e9a2e7f99908962a67eaaac4cfa262
MD5 dd95090d7d060e3696bf99a2db2513fd
BLAKE2b-256 12ed6d2130af3c5f723e364d3bb9d5513f01f3bf00f82d3498de6785ccd37d2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page