Vladimir <AntoscencoVladimir@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date
Message
feat(jira): add optional plugin "tempo" path (#11121)
CHANGE: added new environment variable JIRA_TEMPO_PATH to allow set an optional path
Co-authored-by: Vladimir Antoscenco <vladimir.antoscenco@tekoway.com>
Diff
1diff --git a/plugins/jira/README.md b/plugins/jira/README.md
2index a7cfe6d9e2a61c8d6c4e00528df26176fcdb750d..3d6d323a4a573ece85e76885fab7330f858f2fa4 100644
3--- a/plugins/jira/README.md
4+++ b/plugins/jira/README.md
5@@ -68,6 +68,7 @@ echo "https://jira.atlassian.com" >> .jira-url
6 * `$JIRA_PREFIX` - Prefix added to issue ID arguments
7 * `$JIRA_RAPID_BOARD` - Set to `true` if you use Rapid Board
8 * `$JIRA_DEFAULT_ACTION` - Action to do when `jira` is called with no arguments; defaults to "new"
9+* `$JIRA_TEMPO_PATH` - Your JIRA tempo url path; defaults to "/secure/Tempo.jspa"
101112 ### Browser ###
13diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
14index 0add040d185a192fdb36f60610dddae7a06edb78..71224bdfbd466f3472982690d1188af732c9433d 100644
15--- a/plugins/jira/jira.plugin.zsh
16+++ b/plugins/jira/jira.plugin.zsh
17@@ -56,13 +56,18 @@ function jira() {
18 fi
19 elif [[ "$action" == "tempo" ]]; then
20 echo "Opening tempo"
21- open_command "${jira_url}/secure/Tempo.jspa"
22+ if [[ -n "$JIRA_TEMPO_PATH" ]]; then
23+ open_command "${jira_url}${JIRA_TEMPO_PATH}"
24+ else
25+ open_command "${jira_url}/secure/Tempo.jspa"
26+ fi
27 elif [[ "$action" == "dumpconfig" ]]; then
28 echo "JIRA_URL=$jira_url"
29 echo "JIRA_PREFIX=$jira_prefix"
30 echo "JIRA_NAME=$JIRA_NAME"
31 echo "JIRA_RAPID_BOARD=$JIRA_RAPID_BOARD"
32 echo "JIRA_DEFAULT_ACTION=$JIRA_DEFAULT_ACTION"
33+ echo "JIRA_TEMPO_PATH=$JIRA_TEMPO_PATH"
34 else
35 # Anything that doesn't match a special action is considered an issue name
36 # but `branch` is a special case that will parse the current git branch