Bulk Change of Filter Owners in Jira Cloud

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

Summary

This article provides a step-by-step guide on updating filter owners in bulk in Jira Cloud using the REST API. Currently, there is no out-of-the-box feature in Jira Cloud for changing filter owners, but this process can be automated through scripting and the use of API calls.

Environment

Jira

Diagnosis

The need to update filter owners in bulk arises when managing multiple filters within Jira Cloud, especially in large organizations where ownership changes frequently.


Cause

There is no native functionality in Jira Cloud to update filter owners in bulk. A feature request JRACLOUD-47656 exists but has not yet been implemented.

Solution

To update filter owners in bulk, you can use the Jira REST API. Below are the steps required to accomplish this task:

Step 1: Retrieve Filters

First, you need to gather the list of filters you wish to update. Use the Filter Search API with the overrideSharePermissions flag set to true. This API call is paginated, so you'll need to handle pagination to retrieve all filters.

Example API Call to Retrieve Filters:


GET /rest/api/3/filter/search?overrideSharePermissions=true&startAt=0&maxResults=50 
Authorization: Bearer <your_access_token> 
Content-Type: application/json


  • Replace <your_access_token> with your actual access token.

  • Adjust startAt and maxResults as needed to handle pagination.

Step 2: Update Filter Owner

Once you have the list of filters, update each filter's owner using the Filter Owner API.

Example API Call to Update Filter Owner:


PUT /rest/api/3/filter/{filterId}/owner 
Authorization: Bearer <your_access_token> 
Content-Type: application/json 
data: { 
   "accountId": "<new_owner_account_id>" 
}


  • Replace {filterId} with the ID of the filter you want to update.

  • Replace <your_access_token> with your actual access token.

Replace <new_owner_account_id> with the account ID of the new owner.

Important Notes

  • Pagination: Make sure your script iterates through all pages of filters when retrieving them. This ensures you capture every filter that needs updating.

  • Error Handling: Integrate error handling in your script to manage any potential API errors, such as network issues or incorrect API request formats.

  • Testing: Always test your script in a safe, non-production environment to verify its functionality and ensure it performs as expected before deploying it in a live environment.

Additional Resources

This process provides a workaround for the absence of built-in bulk update functionality for filter owners, leveraging the flexibility of Jira's REST API to automate this task efficiently.




Last modified on Oct 17, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.