blob: 9fbdfc38571cda197d99ffdf9d0f5f837dd511cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#!/bin/sh
if test "$1"; then
ticket=$1
else
ticket=$(jira-cli issues list -q"project IS NOT EMPTY and project != AUTO and project != NET and project != MSP and project != SYST and project != LOYAL" --order-by="Sprint" -s"Code Review" --columns=KEY,PRIORITY,SUMMARY,ASSIGNEE | fzf --print-query | tail -n1 | cut -f1)
ticket=$(printf "%s" $ticket)
fi
if test "$ticket"; then
echo "Reviewing $ticket ..."
# ugh
#xdg-open https://proactivedealersolutions.atlassian.net/browse/$ticket
xdg-open "https://github.com/pulls?q=is%3Aopen+is%3Apr+user%3ABetterCarPeople+$ticket"
#xdg-open "https://github.com/search?q=is%3Aopen+is%3Apr+org%3ABetterCarPeople+$ticket"
else
exit 1;
fi
start=$(date +%H%M)
start_uts=$(date +%s)
#started="$(date -Iseconds | tr 'T' ' ')"
started="$(date +'%Y-%m-%d %H:%M:%S')"
tz="America/New_York"
date
echo "Press enter when you're done reviewing"
read -r hi
date
end=$(date +%H%M)
end_uts=$(date +%s)
printf "%s - %s %s CR\n" "$start" "$end" "$ticket"
minutes_rounded_up=$(( ((($end_uts - $start_uts )/300)+ 1 ) * 5 ))
printf "should log %dm\n" "$minutes_rounded_up"
jira-cli issue worklog add "$ticket" --comment="CR" --started="$started" --timezone="$tz"
printf "%s - %s %s CR\n" "$start" "$end" "$ticket" | wl-copy
echo "Do you want to move the ticket?"
echo 'jira-cli issue edit '$ticket' --label DBA_Approved --no-input'
echo 'jira-cli issue move '$ticket' "Check out My Work"' #"Pending Demo"'
echo 'jira-cli issue edit '$ticket' --label "Post-mortem_(Demo)" --no-input && jira-cli issue move '$ticket' "Testing"'
|