Created
October 7, 2014 00:15
-
-
Save jnraine/78c26823f965b36494d0 to your computer and use it in GitHub Desktop.
Helper to open JIRA tickets from Terminal
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
# Usage: | |
# ticket <= opens ticket associated with the branch you're on (for branch clio-1234-fix-the-thing, opens CLIO-1234) | |
# ticket 5678 <= opens CLIO-5678 | |
ticket () { | |
ticketNumber=$1 | |
if [ "$ticketNumber" -eq "" ] | |
then | |
ticketNumber=$(git rev-parse --abbrev-ref HEAD | ruby -e "branch=gets.downcase;print branch.match(/^clio-(\d+)/)[1] if branch.start_with?('clio-')") | |
fi | |
if [ "$ticketNumber" -eq "" ] | |
then | |
echo "Enter ticket number or checkout ticket-based branch (e.g., clio-1234-fix-the-thing)" | |
else | |
open "https://themis.atlassian.net/browse/CLIO-${ticketNumber}" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment