I'm trying to get a Bamboo build number, in order for it to be used in JIRA version. The problem I'm facing is when I call the following API in Scriptrunner console
def issueKey = 'esp-45'
def string1 = get('https://mybamboo.com/rest/api/latest/result?issueKey=' + issueKey).asString().body
it returns only
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><results expand="results"><results expand="result" start-index="0" max-result="0" size="0"/><link href="https://mybamboo.com/rest/api/latest/result" rel="self"/></results>
Rather than
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<results expand="results">
<results expand="result" start-index="0" max-result="1" size="1">
<result key="ESP-DEP-32" state="Successful" lifeCycleState="Finished" number="32" id="7372921">
<link href="https://mybamboo.com/rest/api/latest/result/ESP-DEP-32" rel="self"/>
<plan key="ESP-DEP" name="eSP - eSP Build Plan" shortName="eSP Build Plan" shortKey="DEP" type="chain" enabled="true">
<planKey>
<key>ESP-DEP</key>
</planKey>
<link href="https://mybamboo.com/rest/api/latest/plan/ESP-DEP" rel="self"/>
</plan>
<buildResultKey>ESP-DEP-32</buildResultKey>
<planResultKey>
<key>ESP-DEP-32</key>
<entityKey>
<key>ESP-DEP</key>
</entityKey>
<resultNumber>32</resultNumber>
</planResultKey>
<buildState>Successful</buildState>
<buildNumber>32</buildNumber>
</result>
</results>
<link href="https://mybamboo.com/rest/api/latest/result" rel="self"/>
</results>
which is returned with Postman, for example.
https://mybamboo.com/rest/api/latest/result?issueKey=ESP-45
Hi Anton,
This sounds a bit trivial but in your example:
def issueKey = 'esp-45'
You could try changing the value to upper case to match what is in the returned result (i.e. 'ESP-45')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.