Forums

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

Why can't I filter Ref Restrictions through the REST API

Porter Bassett January 28, 2019

By my reading of the documentation here, I should be able to get a list of all of the read-only branch restrictions on BitBucket server using the following URL:

{serverUrl}/rest/branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restrictions?read-only

But this gives me a list of all of the permissions, not just the read-only permissions.  The list it gives me is identical to what I get from this URL: 

{serverUrl}/rest/branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restriction

Is this a bug, or am I doing something wrong?

1 answer

1 accepted

1 vote
Answer accepted
Dick
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2019

Hi @Porter Bassett,

Thank you for reaching out.

To get a list of all the read-only branch restrictions, you need to provide 'type=read-only' instead of just 'read-only'.

The correct format would then be:

{serverUrl}/rest/branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restrictions?type=read-only

I hope this helps.

Cheers!

Porter Bassett January 29, 2019

That does.  Thank you!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events