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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.