Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Search to list repos with a certain string

David Harvey
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 4, 2022

Using the GUI, I can get a list of  354 files in the account with the string "APIM", but what I'm looking for is a list of repos with that string.   This would seem like an obvious use case.   I would rather not download all repos in the account onto my laptop simply to be able to ask this question.

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 8, 2022

Hi @David Harvey,

Code search indeed returns a list of files with your search term.

You could use our API to get a list of repos e.g. with a call like the following:

curl --user <BitbucketUsername>:<app-password> --request GET 'https://api.bitbucket.org/2.0/workspaces/<workspace-id>/search/code?search_query=APIM&fields=values.file.commit.repository.links.html.href'

This query though will return the repo URL for each file where the search term exists. If there are two files in the same repo with this search term, you will get the repo URL twice in the output.

If you want, I can create a feature request in our issue tracker for the ability to view the list of repos that contain a search term (along with the list files). Please feel free to let me know if you'd like me to proceed with that.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events