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

REST API or process to find

Dilip Mansukhani Apr 06, 2018


would like to known is there any way or any REST API to find out which Jira project is associated with which repository for bitbucket.




1 answer

0 votes
Prasanth Thaikkalloor Atlassian Team Apr 10, 2018

If you are using the default Jira-Bitbucket server integration, it works based on the issue key provided in the commit message. It's not exactly a project in JIRA to Bitbucket Repository integration.  That being said you can use REST API in Bitbucket to get the changesets associated with a issue key and issue keys associated with commits in a specific pull request. So you can use this data and possibly generate the mapping between project in jira and repository relation.

Please see for retails on REST api available REST Resources Provided By: Bitbucket Server - JIRA Integration

You can find more details about jira integration in jira integration.


Prasanth - Atlassian

Dilip Mansukhani Apr 10, 2018

Hi Prasanth,

so does that mean that Jira project and GIT repo are not tightly couple.

for example if i have project A in Jira and we have repository in Bitbucket like repo1,repo2,repo3 so any commit done on repo1 can link to any issuse in jira until that user is part of that project.we would like to know how can we force the user to use a particular repo with particular project in Jira.

currently i see only way is to do permission from project level in Jira which will allow user to access repo of that project only where it has access to Jira of that project.


Please let us know your view on this.



Aron Gombas [Midori] Community Leader Apr 10, 2018

You can implement this with Commit Policy Plugin for Jira plus its adapter for Bitbucket by setting up a custom commit policy for the Bitbucket repo.

The commit policy should contain a JQL condition with a query like this (not tested):

project in projectsWhereUserHasRole("Developers")

This requires the committer to mention issue key(s) from project(s) where he has the "Developer" role.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira Software

How to prevent the propagation of unused project schemes, workflows & screens in Jira software

Atlassian ranks project attributes as the third most important factor impacting performance in the category of data. It’s not surprising, since project attributes are precisely the rules used to ma...

1,512 views 1 19
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