Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

182 views 2 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you