Handle Jira ticket redirects - as a result of a jira ticket being moved to another project
This commit is contained in:
parent
877f022678
commit
8ce4442dd6
1 changed files with 2 additions and 3 deletions
|
|
@ -197,8 +197,8 @@ def extractmerges(String line) {
|
|||
|
||||
def jiraticketexists(String jiraticket) {
|
||||
def String URI = "${JIRA_URI}/browse/${jiraticket}"
|
||||
def String URIforsummary = "${URI}?fields=summary"
|
||||
def get = new URL(URIforsummary).openConnection();
|
||||
def String RestfulURI = "${JIRA_URI}/rest/api/latest/issue/${jiraticket}?fields=summary"
|
||||
def get = new URL(RestfulURI).openConnection();
|
||||
get.setRequestProperty( 'X-AUSERNAME', "${JIRA_USERNAME}" )
|
||||
get.setRequestProperty( 'Authorization', "Basic ${JIRA_ENCODED_PASSWORD}" )
|
||||
get.setRequestProperty( 'User-Agent', 'groovy-2.4.4' )
|
||||
|
|
@ -210,7 +210,6 @@ def jiraticketexists(String jiraticket) {
|
|||
return [false, '', jiraticket]
|
||||
} else {
|
||||
def jsonresponse = new JsonSlurper().parseText(get.inputStream.getText('UTF-8'))
|
||||
echo "Response: ${jsonresponse}"
|
||||
redirectedjiraticket = jsonresponse['key']
|
||||
}
|
||||
return [true, URI, redirectedjiraticket]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue