Hello I'm trying to set project members as editors in python script, but nothing seams to work (looks like possible bug in REST API)
What I've tried:
1. (Worm up) Uodate filter by: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-filters/#api-rest-api-2-filter-id-put
Edited field: sharePermissions , but off course that didn't worked.
2. Add permissions by: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-filter-sharing/#api-rest-api-2-filter-id-permission-post
This went much better. I was able to add some sharing using example from rest api manual with params:
payload = json.dumps( {
"type": "project",
"projectId": "123123"
} )
but that worked only for viewers , but I need to add write(edit) permissions as well.
3. I found extra field to edit rights (poorly documented but that's not a problem in my case) so I modified above request like:
payload = json.dumps( {
"type": "project",
"projectId": "123123",<br> "rights": {"value":3}
} )
Why "rights": {"value":3} ? I found it in request on jira web interface when I was updating permissions manually. I've also tried to pass just number. Whatever I used, i got error:
{
"errorMessages": [
"Unrecognized field \"rights\" (Class com.atlassian.jira.rest.v2.search.SharePermissionInputBean), not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@1414fb89; line: 1, column: 70] (through reference chain: com.atlassian.jira.rest.v2.search.SharePermissionInputBean[\"rights\"])"
]
}4. I also tried to change "rights" to "edit": True, that was run successfully but edit field was skipped, and in share object I get, I still had: "edit": false, . I also verified this by web interface.
BTW, when I tried to use anything else then bool value for edit, I got error:
{
"errorMessages": [
"Can not deserialize instance of boolean out of START_OBJECT token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@1414fb89; line: 1, column: 41] (through reference chain: com.atlassian.jira.rest.v2.search.SharePermissionInputBean[\"edit\"])"
]
}5. I also tried a lot of variants where I tried to edit sharePermission using "PUT" and url = "https://some.jira.com/rest/api/2/filter/123123/permission/45645"
and many more, but every time I've tried something like this, I've got response 405
Do You have any idea, how should I use it?