@com.adaptavist.hapi.platform.analytics.Tracked class Filters extends java.lang.Object
Constructor and description |
---|
Filters() |
Type Params | Return Type | Name and description |
---|---|---|
|
static java.util.Iterator<com.atlassian.jira.issue.search.SearchRequest> |
getAll() Returns an iterable of all SearchRequest objects that the current user has access to (A SearchRequest is also known in the user interface as a Filter) |
|
static com.atlassian.jira.issue.search.SearchRequest |
getById(long filterId) Get a SearchRequest by id (A SearchRequest is also known in the user interface as a Filter) |
|
static java.util.Iterator<com.atlassian.jira.issue.search.SearchRequest> |
getByName(java.lang.String filterName) Returns an Iterable of SearchRequest objects matching a filter name (A SearchRequest is also known in the user interface as a Filter) |
|
static com.atlassian.jira.issue.search.SearchRequest |
getByName(java.lang.String filterName, com.atlassian.jira.user.ApplicationUser ownerUser) Returns a SearchRequest matching a filter name and owner (A SearchRequest is also known in the user interface as a Filter) |
|
static com.atlassian.jira.issue.search.SearchRequest |
getMyFilterByName(java.lang.String filterName) Returns a SearchRequest owned by the current user that matches a given filter name (A SearchRequest is also known in the user interface as a Filter) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Returns an iterable of all SearchRequest objects that the current user has access to (A SearchRequest is also known in the user interface as a Filter)
You can apply your own custom logic to the return of this method enabling you to further filter the list of SearchRequests. See com.atlassian.jira.issue.search.SearchRequest for a list of properties available on a SearchRequest object
e.g: find filters shared with 'Any logged-in users' Filters.getAll().findAll { it.permissions.authenticated }
Get a SearchRequest by id (A SearchRequest is also known in the user interface as a Filter)
Note: This method will only return filters that the user can see. Unless the user is a global admin and the Jira feature flag that allows editing of private entities is set to true.
You can use the return of this to run an Issue search with an existing filter. See: Issues.search
filterId
- the id of the filterReturns an Iterable of SearchRequest objects matching a filter name (A SearchRequest is also known in the user interface as a Filter)
This method can be used to retrieve all filters with the same name that the current user has permissions to view.
e.g: Get a list of filters matching a given name and then find one owned by a given user: Filters.getByName("Jane's Bugs Filter").find { it.owner == Users.getByName('jdoe') }
filterName
- name of the filter to search forReturns a SearchRequest matching a filter name and owner (A SearchRequest is also known in the user interface as a Filter)
Filter names are not unique, however, a user can only own 1 filter with a given name so this method lets you pass in the filter name as well as the user object for the filter owner.
e.g: To get a filter that you own: Filters.getByName("My Bugs Filter", Users.loggedInUser)You can then use that filter to run an Issue search. See: Issues.search
filterName
- name of the filter to search forownerUser
- ApplicationUser object of the filter ownerReturns a SearchRequest owned by the current user that matches a given filter name (A SearchRequest is also known in the user interface as a Filter)