Forums

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

Get Favorite Filters in Plugin

Artemy Matvienko
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.
May 7, 2018

I want to get the list of the filters that the currently logged in user has access to. If necessary, it can be limited to only favorited filters. I've found this REST API endpoint, but I'm wondering if there is a Java API way of getting a similar list. This class list is a bit difficult to navigate, and the component accessor managers or search service don't seem to have a method like the one I need.

1 answer

1 accepted

0 votes
Answer accepted
Aleksandr Zuevich
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.
May 7, 2018

Hi Artemy,

Look please at SearchRequestService class.

Artemy Matvienko
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.
May 8, 2018

Just for my reference, how did you find out that this class does what I need? I actually found that class as well using this way: 

  1. Go to the API page
  2. Click the INDEX link at the top
  3. Search for keywords that would make sense to be in the required function in the format of the Atlassian function names. In my case it was "getFilter".
  4. Look through the results to see if a function matches the requirements.
  5. use ComponentAccessor.getComponent(SearchRequestService.class) to retrieve the instance so you can use the functions

Suggest an answer

Log in or Sign up to answer