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)
  -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.
  
  • Branch naming format is as follows:
    • Default naming strategy {CONVENTIONAL_COMMIT_PREFIX}/{ISSUE_ID}_{ISSUE_TITLE}
    • Basic naming strategy {ISSUE_ID}

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: jira2branch-0.6.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for jira2branch-0.6.0.tar.gz
Algorithm Hash digest
SHA256 ac7d0ee3c0633f69256dfdb1bbb7736770e996cc467b165fa4c29c5b63b0683e
MD5 69b4819ef8ff3cdf6591f2e1b951a65b
BLAKE2b-256 50de6571eed46f60ebcbd08863f75e348cdcb10b06ec3bb6c0bf7363ef979295

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jira2branch-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for jira2branch-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e0583b6fa0b046d81b9046e2f7cd4cfd2641088987fb79c6136577a3e43c0d6
MD5 557837f943dba54c98376e89c37f618a
BLAKE2b-256 cae64faf637b6ad958a2eeb2ee7d8c17edd162d55c2f63347e805e7e8be1b4ad

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