diff options
Diffstat (limited to 'plugins/jira/jira.plugin.zsh')
-rw-r--r-- | plugins/jira/jira.plugin.zsh | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 22807e0ae..e789fce92 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -44,25 +44,31 @@ function jira() { open_command "${jira_url}/secure/CreateIssue!default.jspa" elif [[ "$action" == "assigned" || "$action" == "reported" ]]; then _jira_query ${@:-$action} - elif [[ "$action" == "myissues" ]]; then + elif [[ "$action" == "mine" ]]; then echo "Opening my issues" open_command "${jira_url}/issues/?filter=-1" elif [[ "$action" == "dashboard" ]]; then echo "Opening dashboard" if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then - open_command "${jira_url}/secure/RapidBoard.jspa" + _jira_rapid_board ${@} else open_command "${jira_url}/secure/Dashboard.jspa" fi elif [[ "$action" == "tempo" ]]; then echo "Opening tempo" - open_command "${jira_url}/secure/Tempo.jspa" + if [[ -n "$JIRA_TEMPO_PATH" ]]; then + open_command "${jira_url}${JIRA_TEMPO_PATH}" + else + open_command "${jira_url}/secure/Tempo.jspa" + fi elif [[ "$action" == "dumpconfig" ]]; then echo "JIRA_URL=$jira_url" echo "JIRA_PREFIX=$jira_prefix" echo "JIRA_NAME=$JIRA_NAME" + echo "JIRA_RAPID_VIEW=$JIRA_RAPID_VIEW" echo "JIRA_RAPID_BOARD=$JIRA_RAPID_BOARD" echo "JIRA_DEFAULT_ACTION=$JIRA_DEFAULT_ACTION" + echo "JIRA_TEMPO_PATH=$JIRA_TEMPO_PATH" else # Anything that doesn't match a special action is considered an issue name # but `branch` is a special case that will parse the current git branch @@ -75,7 +81,7 @@ function jira() { # Strip suffixes starting with _ issue_arg=(${(s:_:)issue_arg}) issue_arg=${issue_arg[1]} - if [[ "$issue_arg" = ${jira_prefix}* ]]; then + if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then issue="${issue_arg}" else issue="${jira_prefix}${issue_arg}" @@ -107,6 +113,16 @@ Valid options, in order of precedence: EOF } +function _jira_rapid_board() { + rapid_view=${2:=$JIRA_RAPID_VIEW} + + if [[ -z $rapid_view ]]; then + open_command "${jira_url}/secure/RapidBoard.jspa" + else + open_command "${jira_url}/secure/RapidBoard.jspa?rapidView=$rapid_view" + fi +} + function _jira_query() { emulate -L zsh local verb="$1" |