Be it a beginner in JIRA or a professional, one of the features used often is creating and managing filters. The fact that we can save the searches, share them, and subscribe to them adds a lot of value to JIRA. So, how do we programmatically create and manage filters?
In this recipe, we will learn how to manage filters programmatically.
We will see the following aspects of managing the filters one by one:
Creating a filter
Updating a filter
Deleting a filter
Retrieving a filter
Sharing a filter
Most of the operations on managing filters are done using SearchRequestService
. For creating a filter, perform the following steps:
Create the
Query
object to be saved as a filter. TheQuery
object can be created usingJqlQueryBuilder
, as we have seen in the earlier recipes.Create a
SearchRequest
object from the query:SearchRequest searchRequest = new SearchRequest(query);
Create a JIRA Service context. If you are in an action class, you can get the service...