ApplicationUser from issue.getReporter

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.
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()));
        Query query = jqlQueryBuilder.buildQuery();
        SearchResults searchResults =, query,
        //issues = searchResults.getIssues();
        issues = searchResults.getResults();"Searching: " + query.toString());

        for (Issue issue : issues) {
            ApplicationUser reporter = issue.getReporter();
  "function reporter: " + reporter.getDisplayName()); **CRASHES HERE**
        return issues;

If reporter was null, reporter.getDisplayName() would be throwing a NullPointerException. Perhaps change your log line to"function reporter: " + reporter.toString()) so that you can see the user object instead.

Additionally, you should provide us the log output, since right now you’re only giving us half the information you have.

Thank you for the reply.
getDisplayName should return a string, but I tried your reporter.ToString() method also and both deliver the same error messages:

2019-09-09 08:15:01,031 Caesium-1-3 ERROR anonymous Spam Cleanup Service [c.a.jira.service.ServiceRunner] An error occurred while trying to run service ‘Spam Cleanup Service’. null
at com.atlassian.jira.service.ServiceRunner.runService(
at com.atlassian.jira.service.ServiceRunner.runServiceId(
at com.atlassian.jira.service.ServiceRunner.runJob(
at com.atlassian.scheduler.core.JobLauncher.runJob(
at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(
at com.atlassian.scheduler.core.JobLauncher.launch(
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeClusteredJob(
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeClusteredJobWithRecoveryGuard(
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(
at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(
at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(

I apologize for not giving this earlier (Standard procedure). But let me know what you think.

Which line does this reference? Line 326?

that the:"function reporter: " + reporter.toString());

Can you show us a sanitized screenshot proving the Issue Reporter is not null? Perhaps the value actually is null?

Ok, I got it. I’m not posted nulls anymore and I can see everything in my log files. Here is what I have:

for (Issue issue : issues) {"Issue: " + issue.getKey());"ReporterID: " + issue.getReporterId());

    try {
        ApplicationUser reporter = issue.getReporter();"got AppUser");

        if (reporter == null) {
  "user is null");
        else {
            PropertySet reporterProps = this.userPropertyManager.getPropertySet(reporter);
  "got Reporter Property");
  "reporter is: " + reporter.getName().toString());

    } catch (Exception ex) {"error within Issue");, ex);

And my log:
2019-09-10 14:00:39,792 Caesium-1-3 INFO anonymous Spam Cleanup Service [] Issue: AASCSYS-2607
2019-09-10 14:00:39,793 Caesium-1-3 INFO anonymous Spam Cleanup Service [] ReporterID:
2019-09-10 14:00:39,794 Caesium-1-3 INFO anonymous Spam Cleanup Service [] got Reporter Property
2019-09-10 14:00:39,794 Caesium-1-3 INFO anonymous Spam Cleanup Service [] reporter is:

I’m not 100% sure of why it is now functioning, must be with reporter.getname().toString(). The toString and ensuring it is a string is working great.
Thank you so much!

Happy to assist, good luck now! :slight_smile: