Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo REST API - Search by multiple label values

Hello,

I have a bamboo plan that generates builds with two labels, version and country. Each label can have different values.


For example, I have this two builds:
One contains "version=1_8_1" and "country=us"
Another one contains "version=1_8_1" and "country=fr"

I need to find the build number of the one matching version 1_8_1 and country fr, but I can't figure out how to match by both values

"${url}/rest/api/latest/result/${PROJECT}-${PLAN}.json?expand=results&start-index=0&label=version=1_8_1&label=country=fr" | jq -r .results.result[].buildNumber
24
23

"${url}/rest/api/latest/result/${PROJECT}-${PLAN}.json?expand=results&start-index=0&label=version=1_8_1,country=fr" | jq -r .results.result[].buildNumber
24
23

"${url}/rest/api/latest/result/${PROJECT}-${PLAN}.json?expand=results&start-index=0&label=version=1_8_1&country=fr" | jq -r .results.result[].buildNumber
24
23

If I only try to match the country label it works as expected.
"${url}/rest/api/latest/result/${PROJECT}-${PLAN}.json?expand=results&start-index=0&label=country=fr" | jq -r .results.result[].buildNumber
23

What am I doing wrong? How should the request be formed?

Cheers.

1 answer

I did a test changing the labels so they have only the value but it doesn't work either.

"${url}/rest/api/latest/result/${PROJECT}-${PLAN}.json?expand=results&start-index=0&label=1_8_1&label=fr" | jq -r .results.result[].buildNumber
24
23

"${url}/rest/api/latest/result/${PROJECT}-${PLAN}.json?expand=results&start-index=0&label=version=1_8_1,fr" | jq -r .results.result[].buildNumber
24
23

"${url}/rest/api/latest/result/${PROJECT}-${PLAN}.json?expand=results&start-index=0&label=version=1_8_1&fr" | jq -r .results.result[].buildNumber
24
23

It does say labels should be a comma-separated list ... but that doesn't work either.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center 8.1 is now available

G’day Bamboo customers, Bamboo DC 8.1 is now available with it the following features and programs: SAML 2.0, OpenID Connect, and Crowd SSO In order to help admins with a simplified user manage...

204 views 0 4
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you