feat(jira): support rapid view on rapid board mode (#9459)

* feat(jira): support rapid view on rapid board mode

* Update README to clarify how the rapid board/view works

Co-authored-by: Robby Russell <robby@planetargon.com>
This commit is contained in:
Arnaud Zheng 2023-01-09 20:53:32 +01:00 committed by GitHub
parent 585084354e
commit e0d0dfb845
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -18,8 +18,8 @@ This plugin supplies one command, `jira`, through which all its features are exp
jira # performs the default action jira # performs the default action
jira new # opens a new issue jira new # opens a new issue
jira dashboard [rapid_view] # opens your JIRA dashboard
jira mine # queries for your own issues jira mine # queries for your own issues
jira dashboard # opens your JIRA dashboard
jira tempo # opens your JIRA Tempo jira tempo # opens your JIRA Tempo
jira reported [username] # queries for issues reported by a user jira reported [username] # queries for issues reported by a user
jira assigned [username] # queries for issues assigned to a user jira assigned [username] # queries for issues assigned to a user
@ -67,6 +67,7 @@ echo "https://jira.atlassian.com" >> .jira-url
* `$JIRA_NAME` - Your JIRA username; used as the default user for `assigned`/`reported` searches * `$JIRA_NAME` - Your JIRA username; used as the default user for `assigned`/`reported` searches
* `$JIRA_PREFIX` - Prefix added to issue ID arguments * `$JIRA_PREFIX` - Prefix added to issue ID arguments
* `$JIRA_RAPID_BOARD` - Set to `true` if you use Rapid Board * `$JIRA_RAPID_BOARD` - Set to `true` if you use Rapid Board
* `$JIRA_RAPID_VIEW` - Set the default rapid view; it doesn't work if `$JIRA_RAPID_BOARD` is set to false
* `$JIRA_DEFAULT_ACTION` - Action to do when `jira` is called with no arguments; defaults to "new" * `$JIRA_DEFAULT_ACTION` - Action to do when `jira` is called with no arguments; defaults to "new"
* `$JIRA_TEMPO_PATH` - Your JIRA tempo url path; defaults to "/secure/Tempo.jspa" * `$JIRA_TEMPO_PATH` - Your JIRA tempo url path; defaults to "/secure/Tempo.jspa"

View File

@ -50,7 +50,7 @@ function jira() {
elif [[ "$action" == "dashboard" ]]; then elif [[ "$action" == "dashboard" ]]; then
echo "Opening dashboard" echo "Opening dashboard"
if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then
open_command "${jira_url}/secure/RapidBoard.jspa" _jira_rapid_board ${@}
else else
open_command "${jira_url}/secure/Dashboard.jspa" open_command "${jira_url}/secure/Dashboard.jspa"
fi fi
@ -65,6 +65,7 @@ function jira() {
echo "JIRA_URL=$jira_url" echo "JIRA_URL=$jira_url"
echo "JIRA_PREFIX=$jira_prefix" echo "JIRA_PREFIX=$jira_prefix"
echo "JIRA_NAME=$JIRA_NAME" echo "JIRA_NAME=$JIRA_NAME"
echo "JIRA_RAPID_VIEW=$JIRA_RAPID_VIEW"
echo "JIRA_RAPID_BOARD=$JIRA_RAPID_BOARD" echo "JIRA_RAPID_BOARD=$JIRA_RAPID_BOARD"
echo "JIRA_DEFAULT_ACTION=$JIRA_DEFAULT_ACTION" echo "JIRA_DEFAULT_ACTION=$JIRA_DEFAULT_ACTION"
echo "JIRA_TEMPO_PATH=$JIRA_TEMPO_PATH" echo "JIRA_TEMPO_PATH=$JIRA_TEMPO_PATH"
@ -112,6 +113,16 @@ Valid options, in order of precedence:
EOF 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() { function _jira_query() {
emulate -L zsh emulate -L zsh
local verb="$1" local verb="$1"