Created
September 30, 2016 13:10
-
-
Save MikaelPikael/52d0953895ddb6aba7444cf3b4f349dd to your computer and use it in GitHub Desktop.
open JIRA based on git branch name bash function
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
function jira() { | |
if [ -z "$1" ] | |
then | |
# branch format SOME-JIRA-TASK-NBR_bla_bla | |
nbr=$(git rev-parse --abbrev-ref HEAD | sed "s/_.*//"); | |
else | |
nbr=$1 | |
fi | |
echo open JIRA: $nbr; | |
open https://telavox.atlassian.net/secure/QuickSearch.jspa\?searchString\=$nbr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place in your e.g. .zshrc file
Then go to your git repo directory and type "jira" and it will open JIRA with task number parsed from your local git branch name.
NOTE: The branch should be named something like: JIRA-1234_fix_something_important