When I try to add branch-restriction for desired repo based on this documentation - https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/branch-restrictions with propper users or groups
data = {
"kind": "restrict_merges",
"pattern": "master",
"value": None,
"branch_match_kind": "glob",
"users": ["andrew_polishchuk"]
}
r = requests.post(url="https://api.bitbucket.org/2.0/repositories/%s/%s/branch-restrictions" % (org, repo), headers=headers, data=data)
return r.json()
it returns
{"type": "error", "error": {"message": "malformed users"}} If users is a list of dictionaries (as mentioned in docs) with "nickname", "username" or both it still returns the same error json, i.e. with this
"users": [
{
"username": "andrew_polishchuk"
}
]
Is there any valid payload for adding the desired branch-restriction based on users or groups?