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:
  -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 confirmation before creating the merge request (default is False)
  -d --dry-run         Dry run. Prints out the MR payload in JSON format but does not invoke the API 
  
  --preview (experimental) This toggles live preview ON when editing a merge request description. Requires vim being set as $EDITOR with markdown-preview.vim plugin installed

  --help               Show this message and exit.
  • Branch naming format is as follows:
    • {CONVENTIONAL_COMMIT_PREFIX}/{ISSUE_ID}_{ISSUE_TITLE}

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

Credentials

JIRA

JIRA credentials will be fetched from [USER HOME]/.j2b/secrets.ini 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

[GITLAB CREDENTIALS]

# url = 
# token = 

Required fields

token is required

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

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.5.2.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

jira2branch-0.5.2-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

Supported by

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