Searching an issue is another important operation in JIRA. As you would expect, JRJC provides a SearchRestClient
to do this.
Similar to other REST clients, you can retrieve the SearchRestClient
from JiraRestClient
using a getter method, as shown below:
SearchRestClientsearchClient = jiraRestClient.getSearchClient();
SearchRestClient
uses JIRA Query Language (JQL) to search for issues in JIRA. If you already know JQL, you can search for the issues using the searchJql
method, as shown below:
Promise<SearchResult> result = searchClient.searchJql("project = DEMO");
We can then iterate on the search results and retrieve the field values, as we have seen in the Working with issues recipe:
SearchResultresultObject = result.get(); Iterable<Issue> issues = resultObject.getIssues(); for (Issue issue : issues) { System.out.println("Got issue:"+issue.getKey...