-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogressit.sh
More file actions
executable file
·26 lines (15 loc) · 902 Bytes
/
progressit.sh
File metadata and controls
executable file
·26 lines (15 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash -x
test "X${__USER}" = "X" -o "X${__PASS}" = "X" -o "X${__TICKET}" = "X" -o "X${__URL}" = "X" && exit 1
MYBASE=`dirname $0` ; test "X${MYBASE}" = "X" && exit 2
CWD=`pwd` ; test "X${CWD}" = "X" && exit 3
FQBASE=`echo "${MYBASE}"|perl -p -e "s|(^[^/]+)|${CWD}/\1|g"`
test "X${FQBASE}" = "X" && exit 4
cd "${FQBASE}" || exit 5
test "X${*}" = "X" && exit 1
COMMENT="${*}"
PUTCOMMENT=`cat ${FQBASE}/jira.jsons/inprogress.json|perl -p -e "s|\%\%COMMENT\%\%|${COMMENT}|g"|curl --max-time 30 -s -S -f --write-out '\n\nHTTPCODE=%{http_code}\n' -D- -u ${__USER}:${__PASS} -X POST -H "Content-Type: application/json" \
${__URL}/rest/api/2/issue/${__TICKET}/transitions?expand=transitions.fields \
--data @-`
PUTCOMMENTOK=`echo "${PUTCOMMENT}"|grep "^HTTPCODE="|awk -F\= {'print $2'}|awk {'print $1'}|head -1`
echo "${PUTCOMMENTOK}" | egrep "^20[0-4]$" || exit $?
exit 0