Getting branches for a commit (Stash REST api)

I read this
https://developer.atlassian.com/static/rest/stash/3.11.1/stash-branch-utils-rest.html

I am trying to get the branches associated with a specific commit. However, it does not seem to work with personal projects...

This does not work (gives me a 404 error):

https://stash-server.org/rest/branch-utils/1.0/users/MyUser/repos/MyRepo/branches/info/6301fc06a6d2f2171ca817f7d17eecb0889fcf23

 

But this works:

https://stash-server.org/rest/branch-utils/1.0/projects/Project_Key/repos/MyRepo/branches/info/6301fc06a6d2f2171ca817f7d17eecb0889fcf23

 

The only difference is the project key in one case: '/projects/Project_key/'

And the user project in the other case: '/users/MyUser/'

 

1 answer

1 accepted

Hi Matthieu,

The structure of the command will remain the same, except that for the personal project of your user you just need to type as ~username - in Stash, personal projects are actually preceded by a tilde (~).

So, in your case, the command will be: https://stash-server.org/rest/branch-utils/1.0/projects/~MyUser/repos/MyRepo/branches/info/6301fc06a6d2f2171ca817f7d17eecb0889fcf23

Regards,

Gustavo Refosco

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

30,289 views 26 12
Join discussion

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