The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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.

TAGS
AUG Leaders

Atlassian Community Events