How to change the owner of the filter automatically in jira REST

Sri Sandhya April 27, 2023

As I said the filter owner is someone else but need to change the ownership via JIRA REST API.

1 answer

0 votes
Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2023

Hi @Sri Sandhya ,


Take a look at the documentation here: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filters/#api-rest-api-3-filter-id-owner-put
That should do what you need. Keep in mind that you either need to be the owner of the filter or have Jira admin rights for you to be able to change the filter's owner.

Cheers,
Peter

Sri Sandhya May 8, 2023

Hi @Peter Van de Voorde 

That method is in experimental mode right. Is that will work?

Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 9, 2023

There is only one way to know and that is to try.

I haven't done this myself, but I would recommend you just try it out and see if it works.

Cheers,
Peter

Sri Sandhya May 15, 2023

Hello @Peter Van de Voorde

I tried but got 404 error.

Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 15, 2023

How did you try to call the endpoint? Keep in mind that you need to do a PUT not a GET.

And also make sure to remove the /jira/ part of the url, so make sure you use the following url endpoint, for example the below url returns all your filters:

 

https://<yourinstance>.atlassian.net/rest/api/3/filter/my

Sri Sandhya May 19, 2023

Hello @Peter Van de Voorde 

url=domain + f"filter/{filter_id}/owner"
payload=json.dumps({
"name": "name of the user"
})
response=requests.request(
"PUT",
url,
headers=headers,
data=payload
)

like this I tried because I dont have account id So I used name and key as well.

But still facing 404 error.

404 b'{"message":"null for uri:..., "status-code":404}

Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2023

@Sri Sandhya without the account id it will always return a 404 (This is explained in the documentation).

You'll need to find the account id of the user first, you can use this endpoint to get an accountId for a certain username: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-bulk-migration-get

Sri Sandhya July 3, 2023

Hi @Peter Van de Voorde 
I tried to get account id but it is giving empty results 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events