Hello! I am trying to add a filter to favourites using the REST API, and I make this call:
### Request
curl -u gpassino -v -d '{"favourite":true}' -H 'Content-Type: application/json' -X PUT https://jira.prod.bloomberg.com/rest/api/2/filter/25109
### Response
{"self":"https://jira.prod.bloomberg.com/rest/api/2/filter/25109","id":"25109","name":"temp peppe","description":"hello","owner":{"self":"https://jira.prod.bloomberg.com/rest/api/2/user?username=gpassino","key":"gpassino","name":"gpassino","avatarUrls":{"48x48":"https://www.gravatar.com/avatar/19bd32320d9eaa7e2bed642709c4a73f?d=mm&s=48","24x24":"https://www.gravatar.com/avatar/19bd32320d9eaa7e2bed642709c4a73f?d=mm&s=24","16x16":"https://www.gravatar.com/avatar/19bd32320d9eaa7e2bed642709c4a73f?d=mm&s=16","32x32":"https://www.gravatar.com/avatar/19bd32320d9eaa7e2bed642709c4a73f?d=mm&s=32"},"displayName":"Giuseppe Passino","active":true},"jql":"labels = TeamMoca AND summary !~ coordination AND status != Done AND (resolution != withdrawn AND resolution != \"Won't Do\" OR resolution is EMPTY) ORDER BY Rank ASC","viewUrl":"https://jira.prod.bloomberg.com/issues/?filter=25109","searchUrl":"https://jira.prod.bloomberg.com/rest/api/2/search?jql=labels+%3D+TeamMoca+AND+summary+!~+coordination+AND+status+!%3D+Done+AND+(resolution+!%3D+withdrawn+AND+resolution+!%3D+%22Won't+Do%22+OR+resolution+is+EMPTY)+ORDER+BY+Rank+ASC","favourite":false,"sharePermissions":[{"id":85905,"type":"loggedin","view":true,"edit":false}],"editable":true,"sharedUsers":{"size":0,"items":[],"max-results":1000,"start-index":0,"end-index":0},"subscriptions":{"size":0,"items":[],"max-results":1000,"start-index":0,"end-index":0}}
(the above is our internal jira installation). The response is 200, but the filter (both the returned one, and if I check in the browser) is still not favourite. Changing other properties such as the name works fine, the problem is just with the "favourite" attribute.
We are using Jira Server 7.13.2.
What could the problem be?
I found an alternative way to set and remove favourite filters via REST on JIRA Server (it works on JIRA 8.8.1 at least):
To set filter with ID 25109 as a favourite of the user whose credentials you give:
To unset filter with ID 25109 as a favourite of the user whose credentials you give:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The JSON of the request is in the question. I also added the JSON of the response, highlighting how "favourite" is still false even after I set it to true.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Giuseppe_Passino ,
not sure if you are still stuck with this. I have had the same problem and found it very frustrating.
I did find an alternative way to set and remove favourite filters via REST:
To set filter with ID 25109 as a favourite of the user whose credentials you give:
To unset filter with ID 25109 as a favourite of the user whose credentials you give:
Hope that is helpful,
Philip
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.