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

Bamboo - SQL Queruy Builds with a certain label

Tim Finch September 4, 2019

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
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 5, 2019

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
AUG Leaders

Atlassian Community Events