How to link Bamboo builds with Jira issue via DB queries
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
The steps outlined on this article are provided AS-IS. This means we've had reports of them working for some customers — under certain circumstances — yet are not officially supported, nor can we guarantee they'll work for your specific scenario.
You may follow through and validate them on your own non-prod environments prior to production or fall back to supported alternatives if they don't work out.
We also invite you to reach out to our Community for matters that fall beyond Atlassian's scope of support!
Summary
The purpose of this page is to provide a DB query which will list all the Bamboo builds with the JIRA issues linked.
Environment
Query has been tested on PostgreSQL DB but should work for other DB types.
Solution
SELECT
BRS.PLAN_NAME,
BRS.BUILD_KEY,
BRS.BUILD_STATE,
BRS.BUILD_DATE,
BRSJ.JIRA_ISSUE_KEY
FROM
BRS_LINKEDJIRAISSUES BRSJ,
BUILDRESULTSUMMARY BRS
WHERE
BRSJ.BUILDRESULTSUMMARY_ID=BRS.BUILDRESULTSUMMARY_ID
ORDER BY BRSJ.JIRA_ISSUE_KEY,BRS.PLAN_NAME