@Override
public void handle(Request request, Response response) {
String issueKey = request.mandatoryParam("key");
JsonWriter json = response.newJsonWriter();
json.beginObject().name("issue").beginObject();
DbSession session = dbClient.openSession(false);
try {
Issue issue = issueService.getByKey(issueKey);
writeIssue(session, issue, json);
actionsWriter.writeActions(issue, json);
actionsWriter.writeTransitions(issue, json);
writeComments(issue, json);
writeChangelog(issue, json);
} finally {
session.close();
}
json.endObject().endObject().close();
}