How to retrieve the commits associated with Jira issue keys in Bitbucket Server and Data Center.
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
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Summary
We can find specific commit IDs that are associated with a particular JIRA issue key within Bitbucket server and datacenter using the below database query.
Environment
7.x,8.x
Solution
The information regarding commits associated with a specific JIRA issue key is stored within the "cs_attribute" table in Bitbucket's database. Therefore, you can utilize the following database query to retrieve the commits pertinent to a particular JIRA key.
select * from cs_attribute where att_value='<Jira Issue Key>'
Note: Please enclose the Jira issue key in single quotes.
Example : select * from cs_attribute where att_value='SCRUM-1'