Looking for some help on an existing plugin we created. We query for issues and then pull the Reporter for each issue found from the query.
My issue is the Application User is always null and I cannot find the Reporter name. I found that we needed to use getResults for the query and not getIssues, but this still had not cleared my issue.
Please point me in the right direction.
I tried switching between issue.getReporter and issue.getReporterUser and getting the same results.
Brian
JIra Server 8.2.3
Atlassian SDK 8.0.16
private List<Issue> getSpamIssues(ApplicationUser user) throws SearchException {
List<Issue> issues = new ArrayList<Issue>();
JqlQueryBuilder jqlQueryBuilder = JqlQueryBuilder.newBuilder();
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, (int) (-1 * this.delay.longValue()));
jqlQueryBuilder.where().resolution().eq(this.resolution).and()
.resolutionDate().lt(calendar.getTime());
Query query = jqlQueryBuilder.buildQuery();
SearchResults searchResults = this.searchService.search(user, query,
PagerFilter.getUnlimitedFilter());
//issues = searchResults.getIssues();
issues = searchResults.getResults();
this.log.info("Searching: " + query.toString());
for (Issue issue : issues) {
ApplicationUser reporter = issue.getReporter();
this.log.info("function reporter: " + reporter.getDisplayName()); **CRASHES HERE**
}
return issues;
}