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,368,853
Community Members
 
Community Events
168
Community Groups

List all repositories of specific project

Hi,

 

How can I detect for specific project which repositories exist in it using an API call ?

 

I need to implement a process that for specific project displays all the existing repositories.

2 answers

1 accepted

1 vote
Answer accepted
Pramodh M Community Leader Dec 23, 2021

Hi @Eyal Goren

Use this API and let me know

curl -s -k --request GET --user "username:password" "https://<host>/rest/api/1.0/projects/<projectkey/repos"

 Bitbucket API.png

It's working fine for me. Let me know once you use this API

Thanks,
Pramodh

Yes, this works, thanks!!!

 

Eyal

Like Pramodh M likes this
0 votes
Pramodh M Community Leader Dec 22, 2021

Hi @Eyal Goren 

Using API Ref here

https://docs.atlassian.com/bitbucket-server/rest/5.15.0/bitbucket-rest.html

curl -s --request GET --user "${username}:${token}" https://stash.atlassian.com/rest/api/1.0/projects/{projectKey}/repos

You will get the JSON response from the curl request, which you later extract the data from jq tool

Thanks,
Pramodh

Hi,

 

I tried it, it returned nothing-

 

curl -s --request GET --user "<user>:<token>" https://<host>/rest/api/1.0/projects/<proj name>/repos

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events