Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,362,008
Community Members
 
Community Events
168
Community Groups

How to get all Bitbucket Projects/Repos linked to Jira Projects/Issues

I needed to know which bitbucket projects are linked to which Jira projects.

i could not find any answer so i am writing this question and also answering it myself and maybe it helps someone.

In Jira the infos are capsuled in the database table AO_<HEX>_DEV_SUMMARY in the column "json". extracting the infos on jira issues with bitbucket links is really hard this way.

if you have a look into bitbucket database there is the table "AO_777666_JIRA_INDEX" with all the infos you need:

1. ISSUE -> contains all Jira issue-keys with links in bitbucket

2. Repository -> contains repository-id for bitbucket repo

-> now join with table repository and one more time with project and you can extract jira tickets to bitbucket projects.q

Just use following SQL if you have Postgresql:

SELECT distinct split_part(JI."ISSUE",'-', 1) AS BITBUCKETPROJECT, PRO.PROJECT_KEY AS JIRAPROJECT FROM "AO_777666_JIRA_INDEX" AS JI

INNER JOIN repository REP ON JI."REPOSITORY" = REP.ID

INNER JOIN project PRO ON REP.PROJECT_ID = PRO.id

or you can use following SQL for any other database and afterwards you have to do a splitstring for the jira issueskey to extract the project keys:

 

SELECT JI."ISSUE" AS BITBUCKETPROJECT, PRO.PROJECT_KEY AS JIRAPROJECT FROM "AO_777666_JIRA_INDEX" AS JI

INNER JOIN repository REP ON JI."REPOSITORY" = REP.ID

INNER JOIN project PRO ON REP.PROJECT_ID = PRO.id

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

3,503 views 3 10
Read article

Atlassian Community Events