How to find public issue trackers and wikis in a workspace
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
In some organizations, Bitbucket Cloud admins might want to make their entire workspace, including their repository wikis and issue trackers, completely private.
Currently, Bitbucket Cloud does not have a view that lists the repositories that contain this public data within workspaces. However, by leveraging Bitbucket's API, it is possible to list the repositories with public issue trackers and wikis.
Environment
Bitbucket Cloud
Solution
The following API query leverages the "values.wiki_private" and "values.issues_private" fields from the /2.0/repositories/ endpoint to look for public wikis and issue trackers, as these fields are now available to this endpoint.
1
https://api.bitbucket.org/2.0/repositories/<workspaceID>?fields= +values.wiki_private, +values.issues_private &q= (has_issues=true AND issues_private=false) OR (has_wiki=true AND wiki_private=false)
For more information on the encoding of ‘+’ in the provided API call and any other field parameters associated with this, refer to the field parameters syntax section of our developer documentation.
For more detailed information on this API call, refer to our REST APIs developer documentation.
Usage example with CURL:
1
curl -X GET -u <username>:<appPassword> "https://api.bitbucket.org/2.0/repositories/atlassian?fields=next,%2Bvalues.full_name,%2Bvalues.wiki_private,%2Bvalues.issues_private&q=(has_issues%3Dtrue%20AND%20issues_private%3Dfalse)%20OR%20(has_wiki%3Dtrue%20AND%20wiki_private%3Dfalse)"
The output of this query will look something like this:
1
2
3
4
5
6
7
8
9
{
"values": [
{
"full_name": "atlassian/bitbucket",
"issues_private": false,
"wiki_private": true
}
]
}
⚠️ Please note that the output above will only show repositories that have either a public wiki or a public issue tracker.
ℹ️ For this example, it means that the "atlassian/bitbucket" repository has a public issue tracker, and a private wiki.
Next steps
Once you have a complete list of repositories that have public wikis and issue trackers in them, you can follow the instructions from the pages below to make these resources private:
Making a wiki private:https://support.atlassian.com/bitbucket-cloud/docs/make-a-wiki-private-or-public/
Making an issue tracker private:https://support.atlassian.com/bitbucket-cloud/docs/make-the-tracker-private-or-public/
Was this helpful?