From 54779e5250f362ebd1cf6a7094657f2c894958c3 Mon Sep 17 00:00:00 2001 From: Matthias Heyman Date: Thu, 29 Jun 2023 13:29:14 +0200 Subject: [PATCH] fix(jira): support identifiers delimited with a hyphen (#11782) Co-authored-by: Matthias Heyman --- plugins/jira/jira.plugin.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index e789fce92..b6ee9f100 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -80,7 +80,13 @@ function jira() { issue_arg=${issue_arg##*/} # Strip suffixes starting with _ issue_arg=(${(s:_:)issue_arg}) - issue_arg=${issue_arg[1]} + # If there is only one part, it means that there is a different delimiter. Try with - + if [[ ${#issue_arg[@]} = 1 && ${issue_arg} == *-* ]]; then + issue_arg=(${(s:-:)issue_arg}) + issue_arg="${issue_arg[1]}-${issue_arg[2]}" + else + issue_arg=${issue_arg[1]} + fi if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then issue="${issue_arg}" else