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 - SQL Queruy Builds with a certain label

Does anyone have a SQL Query that will list all builds (within a certain project if possible) that have a specific label?

Any help appreciated.

1 answer

0 votes

Hi @Tim Finch

The following query should help you with this:

SELECT
L.NAME
, B.FULL_KEY
, BR.BUILD_NUMBER
, BR.BUILD_STATE
FROM
LABEL L
JOIN BUILDRESULTSUMMARY_LABEL BRL
ON BRL.LABEL_ID=L.LABEL_ID
JOIN BUILD B
ON B.BUILD_ID=BRL.BUILD_ID
LEFT JOIN BUILDRESULTSUMMARY BR
ON BR.BUILDRESULTSUMMARY_ID=BRL.BUILDRESULTSUMMARY_ID
WHERE
B.FULL_KEY LIKE '<PROJ>-%'

(i) You need to change <PROJ> to match the project key of your project.

This query will list not only build results labels, but also the plan ones.

I hope that helps.

Suggest an answer

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

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

67 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