Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How retrieve Bitbucket Repositories linked to Jira Projects using REST API?

Alejandro Villalobos _atSistemas_ February 7, 2018

Hi there,

 

I've connected Jira to a Bitbucket instance using applinks. After that, I've linked a Jira Project to some Bitbucket Repositories using 'Configure Project Links' option under Setttings section inside the Project Administration Page.

Is there any way to retrieve those repositories using Jira REST API?
I need to know what repositories are linked to a project using this feature.

Kind Regards


Some usefult data:
· Jira Software v7.4.1

2 answers

0 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 13, 2018

Hi Alejandro,

Based on the answer in the Community post  Solved: Are there any plans to provide an API for the development panel it does not look like this is possible:

We currently don't have plans to provide an API for the development panel in JIRA. 

Unlike the build status in Bitbucket, the JIRA integration is not a "simple" REST API that allows for storing and retrieving information. It integrates much tighter with the rest of the Atlassian stack to ensure accuracy of the data and the right access controls. 

However, that doesn't mean build information can't be pulled into JIRA via other plugin points that allow adding additional panels to the sidebar, for JIRA Cloud and Server.

At this time please vote on JSWSERVER-15768 - REST API access to information in Development Panel and add your use case to the comments so we can get this implemented.

Cheers,

Branden

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 13, 2018

It might be possible to find this information via the Jira REST API, however the public rest endpoints don't appear to have this information.  Instead I believe you would have to make a REST call to a private endpoint.  These are not always documented very well, and could be changed at any time within Jira.

But that said I did come across a related post from a few years ago that I think is on the right track here.  Please see https://community.atlassian.com/t5/Answers-Developer-Questions/Is-there-a-way-to-get-all-JIRA-projects-linked-to-a-repository/qaq-p/543930

That post is about getting this same information, but doing so from a Fisheye link instead of bitbucket.  But I believe the concept is still similar enough that this might be possible.   From that post @jhinch (Atlassian) showed us you could use this:

<JIRA_BASE_URL>/rest/applinks/1.0/entitylink/list/com.atlassian.applinks.api.application.jira.JiraProjectEntityType/<PROJECT_KEY>?typeId=com.atlassian.applinks.api.application.fecru.FishEyeRepositoryEntityType

But in your case I think you will want to completely remove the '?typeId=....' since this isn't Fisheye (fecru).  You would need to supply the project key when making this call.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events