summaryrefslogtreecommitdiff
path: root/plugins/jira/jira.plugin.zsh
diff options
context:
space:
mode:
authorJosh Christopherson <josh.christopherson@stacksports.com>2019-06-27 14:16:57 -0500
committerMarc Cornellà <marc.cornella@live.com>2020-03-02 23:37:40 +0100
commit587000ec024b800d968ede14fc01ed28818e4b32 (patch)
tree6cd4af17652ff00d5fdcc3bce28822380d4b04df /plugins/jira/jira.plugin.zsh
parent1f6e1555f28e81e63ab0f3d213207975d75892f6 (diff)
downloadzsh-587000ec024b800d968ede14fc01ed28818e4b32.tar.gz
zsh-587000ec024b800d968ede14fc01ed28818e4b32.tar.bz2
zsh-587000ec024b800d968ede14fc01ed28818e4b32.zip
Some tweaks to the Jira plugin
[x] Updating `branch` command to be compatible with git-flow style branches by removing any prefix before attempting to go to the ticket number in Jira. [x] Removing the switch between /browse/ and /issues/ based off of the `JIRA_RAPID_BOARD` setting - as all issues are under browse now it seems.
Diffstat (limited to 'plugins/jira/jira.plugin.zsh')
-rw-r--r--plugins/jira/jira.plugin.zsh10
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
index ed88368cd..cb46f540b 100644
--- a/plugins/jira/jira.plugin.zsh
+++ b/plugins/jira/jira.plugin.zsh
@@ -67,7 +67,9 @@ function jira() {
if [[ "$action" == "branch" ]]; then
# Get name of the branch
issue_arg=$(git rev-parse --abbrev-ref HEAD)
- # Split by _ character and get the first element
+ # Strip prefixes like feature/ or bugfix/
+ issue_arg=${issue_arg##*/}
+ # Strip suffixes starting with _
issue_arg=(${(s:_:)issue_arg})
issue_arg=${issue_arg[1]}
if [[ "$issue_arg" = ${jira_prefix}* ]]; then
@@ -87,11 +89,7 @@ function jira() {
else
echo "Opening issue #$issue"
fi
- if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then
- open_command "${jira_url}/issues/${issue}${url_fragment}"
- else
- open_command "${jira_url}/browse/${issue}${url_fragment}"
- fi
+ open_command "${jira_url}/browse/${issue}${url_fragment}"
fi
}