for (Issue issue : result.getHits()) {
json.beginObject();
String actionPlanKey = issue.actionPlanKey();
ComponentDto file = componentsByUuid.get(issue.componentUuid());
ComponentDto project = file != null ? projectsByComponentUuid.get(file.uuid()) : null;
Duration debt = issue.debt();
Date updateDate = issue.updateDate();
json
.prop("key", issue.key())
.prop("component", file != null ? file.getKey() : null)
// Only used for the compatibility with the Issues Java WS Client <= 4.4 used by Eclipse
.prop("componentId", file != null ? file.getId() : null)
.prop("project", project != null ? project.getKey() : null)
.prop("rule", issue.ruleKey().toString())
.prop("status", issue.status())
.prop("resolution", issue.resolution())
.prop("severity", issue.severity())
.prop("message", issue.message())
.prop("line", issue.line())
.prop("debt", debt != null ? durations.encode(debt) : null)
.prop("reporter", issue.reporter())
.prop("assignee", issue.assignee())
.prop("author", issue.authorLogin())
.prop("actionPlan", actionPlanKey)
.prop("creationDate", isoDate(issue.creationDate()))
.prop("updateDate", isoDate(updateDate))
// TODO Remove as part of Front-end rework on Issue Domain
.prop("fUpdateAge", formatAgeDate(updateDate))
.prop("closeDate", isoDate(issue.closeDate()));
writeIssueComments(commentsByIssues.get(issue.key()), usersByLogin, json);
writeIssueAttributes(issue, json);
writeIssueExtraFields(issue, project != null ? project.getKey() : null, usersByLogin, actionPlanByKeys, extraFields, json);
json.endObject();
}
json.endArray();
}