With a single command, you will be able to create a GitHub pull request from a JIRA ticket.
git jira-pr -t BUY-123 -b development
The above command will fetch the JIRA ticket and create a pull request using the JIRA ticket ID and summary as the pull request title.
- Obtain GitHub access token: https://github.com/settings/tokens
- Obtain JIRA access token: https://id.atlassian.com/manage/api-tokens
- Download & install
github-jira-pr
command line tool
- Create a
jira-pr
file with the following contents:
#!/bin/bash
github-jira-pr \
--github-access-token <INSERT YOUR GITHUB ACCESS TOKEN> \
--jira-access-token <INSERT YOUR JIRA ACCESS TOKEN> \
--jira-email <INSERT YOUR JIRA EMAIL> \
--jira-host <INSERT YOUR JIRA HOST> \
"$@"
- Make it executable:
chmod +x jira-pra
- Store it in a safe place and make sure it's in your
PATH
. I like to use~/.git/bin
You are now able to create PRs directly from JIRA tickets by using the following command on a GitHub repo:
git jira-pr -t BUY-123 -b development