add basic tests for custom-commands

This commit is contained in:
Cory Bennett
2017-09-09 17:20:57 -07:00
parent 29b95a52cb
commit c585244f3e
8 changed files with 235 additions and 60 deletions
+21
View File
@@ -3,3 +3,24 @@ config:
password-source: pass
endpoint: https://go-jira.atlassian.net
user: gojira
project: BASIC
custom-commands:
- name: env
help: print the JIRA environment variables available to custom commands
script: |-
env | sort | grep JIRA
- name: print-project
help: print the name of the configured project
script: "echo $JIRA_PROJECT"
- name: mine
help: display issues assigned to me
script: |-
if [ -n "$JIRA_PROJECT" ]; then
# if `project: ...` configured just list the issues for current project
jira list --template table --query "resolution = unresolved and assignee=currentuser() and project = $JIRA_PROJECT ORDER BY priority asc, created"
else
# otherwise list issues for all project
jira list --template table --query "resolution = unresolved and assignee=currentuser() ORDER BY priority asc, created"
fi