Last active
August 29, 2015 14:14
-
-
Save harunyardimci/20d08ad82b40e614b228 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/bin/bash | |
| SUMMARY=$1 | |
| DESC=$2 | |
| JIRA_URL="http://localhost/rest/api/2/issue/" | |
| JIRA_PROJ="Projectkey" | |
| JIRA_ISSUE_TYPE="Bug" | |
| JIRA_USER="username" | |
| JIRA_PASS="password" | |
| JIRA_KEY=`curl -D- -u ${JIRA_USER}:${JIRA_PASS} -X POST --data "{ \"fields\": { \"project\":{ \"key\": \"${JIRA_PROJ}\" }, \"summary\": \"${SUMMARY}\", \"description\": \"${DESC}\", \"issuetype\": { \"name\": \"${JIRA_ISSUE_TYPE}\" } } }" -H "Content-Type: application/json" ${JIRA_URL} | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep 'key|' | cut -d"|" -f2` | |
| git checkout -b fix/${JIRA_KEY} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment