I'm trying to get the issues in a list or collection by passing a filter through my code.
I found some examples of this using JqlQueryBuilder but I'm unable to find the maven dependency for its use. Is there another method? Or maybe by passing a jql query?
@Sameeksha Shetty Welcome to the community!
You need to use
com.atlassian.jira.bc.issue.search.SearchService
which is part of Jira plugin API (in com.atlassian.jira:jira-api)
Here is a sample using this,
Query query = "YOUR_STRING_JQL";
SearchService searchService =
ComponentAccessor.getComponent(SearchService.class);
// Here is user is user in context or user who want to access
SearchService.ParseResult parseResult = searchService.parseQuery(user, query);
if (parseResult.isValid()) {
SearchResults results = searchService.search(user, parseResult.getQuery(),
PageFilter.getUnlimitedFilter());
List<Issue> issues = results.getIssues(); //here is your desired result
}
Thanks a lot. Do you know which maven dependency works for this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sameeksha Shetty As I have mentioned earlier, this is part of, com.atlassian.jira:jira-api
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.