]>
git.rmz.io Git - dotfiles.git/blob - zsh/plugins/jira/jira.plugin.zsh
1 # To use: add a .jira-url file in the base of your project
2 # You can also set JIRA_URL in your .zshrc or put .jira-url in your home directory
3 # .jira-url in the current directory takes precedence
5 # If you use Rapid Board, set:
6 #JIRA_RAPID_BOARD="yes"
9 # Setup: cd to/my/project
10 # echo "https://name.jira.com" >> .jira-url
11 # Usage: jira # opens a new issue
12 # jira ABC-123 # Opens an existing issue
14 if [ -f .jira
-url ]; then
15 jira_url
=$(cat .jira-url)
16 elif [ -f ~
/.jira
-url ]; then
17 jira_url
=$(cat ~/.jira-url)
18 elif [[ "x$JIRA_URL" != "x" ]]; then
21 echo "JIRA url is not specified anywhere."
26 echo "Opening new issue"
27 `open $jira_url/secure/CreateIssue!default.jspa`
29 echo "Opening issue #$1"
30 if [[ "x$JIRA_RAPID_BOARD" = "yes" ]]; then
31 `open $jira_url/issues/$1`
33 `open $jira_url/browse/$1`
38 alias jira
='open_jira_issue'