I need to replace the permissions of a number of user groups because the groups are going to be renamed in Active Directory.
Due to the number of affected groups and repositories I need to do this automatically and I'm trying to use the REST API for this.
I can retrieve the groups and their permissions without problems, but I have trouble setting the new permissions because the documentation is incomplete:
https://docs.atlassian.com/fisheye-crucible/latest/wadl/fecru.html
If you expand the acceptable request representations part for PUT requests it's just empty. The examples from other PUT requests is not helping either.
The link to the REST API Examples from the documentation leads to a 404 and I can't find it anywhere else.
This is my python function to set the permissions for the new group name:
def repository_permissions_add(self, repository: str, group: str, permissions: object):
json_data = json.dumps({ 'permissions': permissions })
print(json_data)
response = self._put(self.fecru_url + "/rest-service-fecru/admin/repository-permissions/%s/groups/%s" % (repository, group),
data=json_data)
print(response.status_code)
print(response.text)
The json_data that is sent with the request looks like this:
{"permissions": ["CAN_READ", "IS_ADMIN"]}The server responds with a 500 error and the following error message:
Can not deserialize instance of java.util.HashSet out of START_OBJECT token\n at [Source: HttpInputOverHTTP@4b333640[c=41,q=0,[0]=null,s=STREAM]; line: 1, column: 1]
Can anybody point me to the current location of the examples, or where to find the proper data I need to send along the request?