| #!/bin/bash |
| ## ----------------------------------------------------------------------- |
| ## ----------------------------------------------------------------------- |
| |
| [[ ! -v JCL_resovled ]] && { declare -g -a JCL_resolved=(); } |
| |
| ## -------------------------------------------------------------------- |
| ## Intent: Retrieve a list of reason query strings |
| ## -------------------------------------------------------------------- |
| function get_jcl_resolved() |
| { |
| local -n ref=$1; shift |
| |
| local -a tmp=() |
| do_resolved tmp |
| ref+=("$tmp") |
| |
| local query="$(join_by 'OR' "${tmp[0]}")" |
| ref+=("($query)") |
| |
| return |
| } |
| |
| ## -------------------------------------------------------------------- |
| ## Intent: Retrieve a list of reason query strings |
| ## -------------------------------------------------------------------- |
| function get_jql_reasons() |
| { |
| local -n ref=$1; shift |
| |
| ref+=('Cannot Reproduce') |
| ref+=('Duplicate') |
| ref+=('Fixed') |
| ref+=('Incomplete') |
| ref+=("Won't Do") |
| ref+=("Won't Fix") |
| return |
| } |
| |
| ## -------------------------------------------------------------------- |
| ## Intent: Modify search query by ticket resolution |
| ## -------------------------------------------------------------------- |
| function do_resolved() |
| { |
| declare -n ans=$1; shift |
| |
| [[ -v resolved_start ]] && { ans+=("(Resolved >= $resolved_start)"); } |
| [[ -v resolved_end ]] && { ans+=("(Resolved <= $resolved_end)"); } |
| |
| if [[ -v resolved_excl ]]; then |
| filter="$(join_by ',' "${resolved_excl[@]}")" |
| declare -p filter |
| ans+=( "(resolution NOT IN ($filter))" ) |
| fi |
| |
| if [[ -v resolved_incl ]]; then |
| filter="$(join_by ',' "${resolved_incl[@]}")" |
| ans+=( "(resolution IN ($filter))" ) |
| fi |
| |
| [[ -v resolved_not_empty ]] \ |
| && { ans+=('(resolved IS NOT EMPTY)'); } \ |
| || { true; } |
| |
| [[ -v resolved_is_empty ]] \ |
| && { ans+=('(resolved IS EMPTY)'); } \ |
| || { true; } |
| |
| return |
| } |
| |
| : # ($?=0) for source $include |
| |
| # [EOF] |