Linking directly to search queries
Haven't you wondered how we can link to a query from a template or JSP from a custom page or plugin page? In this recipe, we will see how we can create a link, programmatically and otherwise, to use in various places.
How to do it...
Let us first look at creating a search link programmatically. Perform the following steps:
- Create the
Query
object usingJqlQueryBuilder
, as we have seen in the previous recipe. - Create a
IssueSearchParamaters
object as shown here:IssueSearchParameters params = SearchService.IssueSearchParameters.builder().query(query).build();
- Get an instance of the
SearchService
. It could be injected in the constructor of your plugin using dependency injection, or can be retrieved from ...
Get JIRA Development Cookbook - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.