Hi, I'm newbie to Jira plugin development. I need get all issues for specific project by specifying type.
I've tried JqlQueryBuilder, but it's very slow.
Currently I'm getting list of all issues for project and then filtering them:
Collection<Long> issuesIds = issueManager.getIssueIdsForProject(project.getId());
List<Issue> issues = issueManager.getIssueObjects(issuesIds);
However it's not best solution, since getting all issues for project taking also lots of time (less then JqlQueryBuilder, but still too much).
Is there any chance to specify issue type for search to cut unwanted issues?
After further investigation I've figured out the way how specify issue type and sprint in JqlQueryBuilder query:
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField customField = customFieldManager.getCustomFieldObjectByName("Sprint");
SearchService searchProvider = ComponentAccessor.getComponentOfType(SearchService.class);
JqlQueryBuilder builder = JqlQueryBuilder.newBuilder();
SearchResults results = searchProvider
.searchOverrideSecurity(user, builder.buildQuery(), PagerFilter.getUnlimitedFilter());
List<Issue> issues = results.getIssues();
As result you're getting all desired issues.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events