Created
March 26, 2019 14:42
-
-
Save Sleavely/65efc9c208f0ec2e547491eec6129fd4 to your computer and use it in GitHub Desktop.
A bash function for quickly opening tickets in Jira
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
# put this in your ~/.profile or equivalent | |
JIRA_HOST="foobar.atlassian.net" | |
function jira { | |
# Uppercase the argument | |
TARGET_TICKET=${TARGET_TICKET^^} | |
# Inject dash if its not there | |
TARGET_TICKET=$(echo ${1} | sed -E --expression='s/([A-Z]+)([0-9]+)/\1-\2/g') | |
echo "Opening $TARGET_TICKET" | |
opn https://$JIRA_HOST/browse/$TARGET_TICKET | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment