a query with result range still returns the last result only Edited

Hi

I am following an example in the documentation here.

* Use negative indexes to return the last entries in build list, e.g. [-5:-1] returns last five builds in list

This curl command:

 

curl --user usr1:password12 http://localhost:8085/rest/api/latest/result.json?expand=results[-5:-1].result

 

returns 

curl: (3) [globbing] bad range specification in column 66

I have 37 results for this plan.

A simpler command using [0] also returns error

curl --user usr1:password12 http://localhost:8085/rest/api/latest/result.json?expand=results[0].result

[globbing] bad range in column 70.

 

I solved the problem with globbing error by using -g flag. However I only get the latest result. 

results[0].result works as expected

results[-5:-1].result still returns the last result. Currently there are 38 results in my plan.

 

1 answer

I found the answer for this error :

curl: (3) [globbing] bad range specification in column

  -g flag has to be used with a curl command that includes brackets.

Error is gone when -g is used. So this command works:

url --user usr1:password12 http://localhost:8085/rest/api/latest/result.json?expand=results[0].result

But this command only returns the last result (the same as the result when using [0]):

url --user usr1:password12 http://localhost:8085/rest/api/latest/result.json?expand=results[-5:-1].result

even though I have multiple results. What am I missing? Thank you.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,798 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you