blob: 9d2d56373bd39e55caf7aa2cbac906f5e05b1308 [file] [log] [blame]
Joey Armstrong3134bfd2024-02-10 20:51:25 -05001#!/bin/bash
2
3## --------------------------------------------------------------------
4## Intent: Retrieve a list of reason query strings
5## --------------------------------------------------------------------
6function get_jql_reasons()
7{
8 local -n ref=$1; shift
9
10 ref+=('Cannot Reproduce')
11 ref+=('Duplicate')
12 ref+=('Fixed')
13 ref+=('Incomplete')
14 ref+=("Won't Do")
15 ref+=("Won't Fix")
16 return
17}
18
19## --------------------------------------------------------------------
20## Intent: Modify search query by ticket resolution
21## --------------------------------------------------------------------
22function do_resolved()
23{
24 declare -n ans=$1; shift
25 # declare -g resolved
26
27 [[ -v resolved_start ]] && { ans+=("(Resolved >= $resolved_start)"); }
28 [[ -v resolved_end ]] && { ans+=("(Resolved <= $resolved_end)"); }
29
30 if [[ -v resolved_excl ]]; then
31 filter="$(join_by ',' "${resolved_excl[@]}")"
32 declare -p filter
33 ans+=( "(resolution NOT IN ($filter))" )
34 fi
35
36 if [[ -v resolved_incl ]]; then
37 filter="$(join_by ',' "${resolved_incl[@]}")"
38 ans+=( "(resolution IN ($filter))" )
39 fi
40
41 [[ -v resolved_not_empty ]] && { ans+=('(resolved IS NOT EMPTY)'); }
42 [[ -v resolved_is_empty ]] \
43 && { ans+=('(resolved IS EMPTY)'); } \
44 || { true; }
45
46 return
47}
48
49: # ($?=0) for source $include
50
51# [EOF]