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.8.0.tar.gz (11.0 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.8.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jira2branch-0.8.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.9 Darwin/25.0.0

File hashes

Hashes for jira2branch-0.8.0.tar.gz
Algorithm Hash digest
SHA256 4c8eb9611c2b15f3530015ded1d99fdaab1e4704b7dc26b131666e648b44c40c
MD5 134f86a517a09f288d0a3d0cdd658e50
BLAKE2b-256 147d58ddacf5c4e941cfe65bf229601a6abaae6e2b3a6ae9a4cd9fe0487c94b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jira2branch-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.9 Darwin/25.0.0

File hashes

Hashes for jira2branch-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a17633149bedbf623191aa96ae9b6c4e08871b0ad9827efcd05d10e26e0046d
MD5 19282cb52254ee12a242a20ca4a9bd19
BLAKE2b-256 75dd0662ded08d7a2e9cd001ef31f2e0b6bedb12e80c3d6e8d5ea28ab43665e1

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