Created
April 3, 2017 13:43
-
-
Save michaelboke/194e728a3b098d85fa47a7264d0ac02b to your computer and use it in GitHub Desktop.
summarize jira tickets between branches, with title lookup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
TARGET="master" | |
SOURCE="develop" | |
USERNAME="jirausername" | |
PASSWORD="jirapassword" | |
FIELD="summary" | |
for ISSUE in `git log $TARGET..$SOURCE --pretty=oneline | perl -ne '{ /(\w+)-(\d+)/ && print "$1-$2\n" }' | sort | uniq`; do | |
JSON=$(curl -s -u $USERNAME:$PASSWORD -X GET https://jira.voiceworks.com/rest/api/latest/issue/$ISSUE?fields=summary) | |
SUMMARY=$(echo $JSON | awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'$FIELD'\042/){print $(i+1)}}}' | tr -d '"' | sed -n $1p) | |
echo "[$ISSUE] $SUMMARY" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment