blob: 88b68358a216c76c2046591e82149f853d9e8838 [file] [log] [blame]
Joey Armstrong3134bfd2024-02-10 20:51:25 -05001#!/bin/bash
Joey Armstrong6890fa92024-08-15 12:14:37 -04002## -----------------------------------------------------------------------
3## -----------------------------------------------------------------------
4
5[[ ! -v JCL_resovled ]] && { declare -g -a JCL_resolved=(); }
6
7## --------------------------------------------------------------------
8## Intent: Retrieve a list of reason query strings
9## --------------------------------------------------------------------
10function get_jcl_resolved()
11{
12 local -n ref=$1; shift
13
14 local -a tmp=()
15 do_resolved tmp
16 ref+=("$tmp")
17
18 local query="$(join_by 'OR' "${tmp[0]}")"
19 ref+=("($query)")
20
21 return
22}
Joey Armstrong3134bfd2024-02-10 20:51:25 -050023
24## --------------------------------------------------------------------
25## Intent: Retrieve a list of reason query strings
26## --------------------------------------------------------------------
27function get_jql_reasons()
28{
29 local -n ref=$1; shift
30
31 ref+=('Cannot Reproduce')
32 ref+=('Duplicate')
33 ref+=('Fixed')
34 ref+=('Incomplete')
35 ref+=("Won't Do")
36 ref+=("Won't Fix")
37 return
38}
39
40## --------------------------------------------------------------------
41## Intent: Modify search query by ticket resolution
42## --------------------------------------------------------------------
43function do_resolved()
44{
45 declare -n ans=$1; shift
Joey Armstrong3134bfd2024-02-10 20:51:25 -050046
47 [[ -v resolved_start ]] && { ans+=("(Resolved >= $resolved_start)"); }
48 [[ -v resolved_end ]] && { ans+=("(Resolved <= $resolved_end)"); }
49
50 if [[ -v resolved_excl ]]; then
51 filter="$(join_by ',' "${resolved_excl[@]}")"
52 declare -p filter
53 ans+=( "(resolution NOT IN ($filter))" )
54 fi
55
56 if [[ -v resolved_incl ]]; then
57 filter="$(join_by ',' "${resolved_incl[@]}")"
58 ans+=( "(resolution IN ($filter))" )
59 fi
60
Joey Armstrong6890fa92024-08-15 12:14:37 -040061 [[ -v resolved_not_empty ]] \
62 && { ans+=('(resolved IS NOT EMPTY)'); } \
63 || { true; }
64
Joey Armstrong3134bfd2024-02-10 20:51:25 -050065 [[ -v resolved_is_empty ]] \
66 && { ans+=('(resolved IS EMPTY)'); } \
67 || { true; }
68
69 return
70}
71
72: # ($?=0) for source $include
73
74# [EOF]