Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Calling Bamboo API does not return full body in Scriptrunner

Anton Murakhovski October 4, 2017

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

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Stephen Cheesley _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2017

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')

TAGS
AUG Leaders

Atlassian Community Events