Skip to content

Instantly share code, notes, and snippets.

@Sleavely
Created March 26, 2019 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sleavely/65efc9c208f0ec2e547491eec6129fd4 to your computer and use it in GitHub Desktop.
Save Sleavely/65efc9c208f0ec2e547491eec6129fd4 to your computer and use it in GitHub Desktop.
A bash function for quickly opening tickets in Jira
# 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