Quickly make JIRA tickets from the command line.
-
Login to JIRA and create an API token at https://id.atlassian.com/manage-profile/security/api-tokens
-
Install
go-jira
:
go install github.com/go-jira/jira/cmd/[email protected]
(If go is not installed, install it: brew install go
)
- Ensure your GOPATH is on your shell path.
which jira
should return something.
If it does not, add the following to your ~/.zshrc
:
# GOPATH is usually ~/go on macOS systems.
export PATH=$PATH:~/go/bin
- Add the following to your
~/.zshrc
and edit the environment variables as necessary.
export JIRA_API_TOKEN=changeme
export [email protected]
export JIRA_ENDPOINT=https://changeme.atlassian.net
export JIRA_PROJECT=MYPROJ
# example:
# $ mkjira "This is a ticket"
# OK JIRA-123 https://jira.example.org/JIRA-123
mkjira() {
summary="$@"
jira create \
--noedit \
--issuetype Task \
--endpoint $JIRA_ENDPOINT \
--login $JIRA_LOGIN \
--project $JIRA_PROJECT \
--override summary="$summary"
}
$ mkjira "This is a test"
OK JIRA-123 https://jira.example.org/JIRA-123