The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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

TAGS
AUG Leaders

Atlassian Community Events