REST API or process to find


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

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

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.



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
Community showcase
Published Feb 26, 2019 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...

628 views 0 7
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you