Hi
In JIRA Cloud I can share a filter with any role when I select a project and it worked just fine. With the REST API, if I share my filter with a role I'm part of, it works but I got an error when I try to share the filter with a role I'm not part of.
Do you have any workarount for this ?, Is this the expected behavior ? Sharing with the entire project works.
My payload is
{
"type": "projectRole",
"projectId": "10000",
"projectRoleId": "10002",
"rights": 1
}
When I'm part of role 10000 it works but as soon as I use another role it does not.
Regards
Hi @Florian Bonniec,
@Tomislav Tobijas is correct - this is expected behavior for security reasons. Here are a few workarounds:
Option 1: Service Account Approach
Option 2: Dynamic Role Management
/rest/api/3/project/{projectKey}/role/{roleId}
endpointsOption 3: Admin Privilege Escalation
Option 4: Alternative Sharing Method
API Sequence Example:
1. POST /rest/api/3/project/{projectKey}/role/{roleId} - Add yourself
2. PUT /rest/api/3/filter/{filterId}/permission - Share filter
3. DELETE /rest/api/3/project/{projectKey}/role/{roleId} - Remove yourself
The service account approach is cleanest for automation scenarios.
Need help implementing any of these patterns? Feel free to DM me!
Hi @Florian Bonniec ,
I believe this is expected behavior—when sharing a filter with a project role via the REST API, you can only share it with roles that you are a member of in that project. This is 'by design' to ensure users can only share filters with the roles they have access to.
This limitation applies to end users and also Jira admins, unless you are the owner of the filter and a member of the target project role.
There's a relatively connected feature suggestion which you can take a look at: JRACLOUD-60899: As a Jira administrator I cannot view change the sharePermissions & editPermissions for private filters & private dashboards via REST API (not sure if there's a feature request directly connected with what you're looking for)
You could use REST API together with POST request to add yourself (or any other account you use for integration) to specific project role(s) within the project, and after that, make that API call related to the filter you need to update. 👀
Not sure if there are any other 'workarounds' you could use.
Cheers,
Tobi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.