Skip to content

Instantly share code, notes, and snippets.

@Bazze
Last active September 6, 2017 09:23
Show Gist options
  • Save Bazze/21a896ad6c8c318d7b53ed7ab7a36379 to your computer and use it in GitHub Desktop.
Save Bazze/21a896ad6c8c318d7b53ed7ab7a36379 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Usage: ./extract-jira-issues.sh <git revision/tag/branch> <git revision/tag/branch>
START_REV=$1
END_REV=$2
JIRA_STATUSES="Done,\"Ready for QA\""
JIRA_URL="https://my-jira-url.atlassian.net"
ISSUES=$(
git log ${START_REV}..${END_REV} --pretty=oneline |
perl -ne '{ /(\w+)-(\d+)/ && print "$1-$2\n" }' |
sort | uniq | xargs |
sed -e 's/ /%2C/g'
)
echo "${JIRA_URL}/issues/?jql=issue in (${ISSUES}) and status in (${JIRA_STATUSES})" | sed -e 's/ /%20/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment