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

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
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,487 views 4 8
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