Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing filter with a project role I'm not part of using the REST API

Florian Bonniec
Community Champion
August 4, 2025

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

2 answers

1 vote
Vitalii Rybka
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2025

Hi @Florian Bonniec,

@Tomislav Tobijas is correct - this is expected behavior for security reasons. Here are a few workarounds:

Option 1: Service Account Approach

  • Create a dedicated service account with broader project role memberships
  • Use this account for filter sharing operations
  • Add it to all relevant project roles you need to share with

Option 2: Dynamic Role Management

  • Use REST API to temporarily add your account to the target role
  • Share the filter
  • Remove yourself from the role afterwards
  • /rest/api/3/project/{projectKey}/role/{roleId} endpoints

Option 3: Admin Privilege Escalation

  • If you're a Jira admin, you might need to make yourself the filter owner first
  • Transfer ownership back after sharing if needed

Option 4: Alternative Sharing Method

  • Share with entire project instead of specific roles
  • Use group-based sharing if your roles map to groups
  • Consider using dashboard sharing with embedded filters

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!

1 vote
Tomislav Tobijas
Community Champion
August 4, 2025

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events