go-bitbucket
go-bitbucket copied to clipboard
400 Bad Request when setting branch permissions using groups
When setting branch permissions restrict_merges am passing map[string]string{"admin": "administrator", "dev": "developer"} as the BranchRestrictionsOptions.Groups value . It throws an error 400 Bad Request and sets the permission group to Everybody
Why are we passing a map and not a array of strings like Users . The buildBranchRestrictionsBody in BranchRestrictions.Create does not use the key value of the maps . Another Observation was branchRestrictionsBodyGroup uses the field Name When i used slug manually adding the restriction it seemed to work
"groups":[ { "slug":"developers" }, { "slug":"administrators" } ]
Oh. Surely I created the struct and method. But, maybe the rules of Atlassian's bitbucket api have changed over the years.