How to get the Stash repository name from stash home's repository number?

I noticed that in the stash-home/shared/data/repositories directory stores all the repositories that are on stash, but they are numbered.

From a number, how do I find out which repository it corresponds to in Stash? (i.e. the project and repository name in Stash).

3 answers

I found this info in the database:

select repository.name, project.project_key from repository JOIN project ON repository.project_id = project.id  where repository.id='WRITE_THE_ID_HERE';

Not sure how to get from the number to the name, but the other way around is relatively easy: The full path to the folder containing the repo is displayed on the main Settings page of the repo.

Stash's REST interface is based on the repository slug, so a lookup with an ID is not easily possible (except you fetch all the repositories and search for the id field in the JSON output).

A short hack would be (if you know the project of the repo) to go to the project's repository list in Stash and execute the following Javascript snippet (and substitute the ID below):

AJS.$('#repositories-table tbody tr a[data-repository-id=11]').closest('tr').children('td,th').css('background-color','#cc0');

This will mark the row of the repository smile

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,123 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