taskadapter / redmine-java-api

Redmine Java API
Apache License 2.0
270 stars 163 forks source link

issue.getJournals() return an empty Collection<Journal> #301

Closed Benoit-Besnier closed 6 years ago

Benoit-Besnier commented 6 years ago

Here a sample :

RedmineManager redmine = RedmineManagerFactory.createWithApiKey(rmUri , rmAccessKey);
final Map<String, String> params = new HashMap<>();
Collection<Journal> journals;

params.put("issue_id", "107263"); // 107263 can be replaced by any valid issue id
params.put("include", "journals");

redmine.getIssueManager().getIssues(params).getResults();

for (Issue issue : issues) {
    journals = issue.getJournals(); // journals.size() = 0 but should be equal to 11 :(
   // ...
}

Any idea about this result ? Did I do something wrong with getIssues() ?

jpthomasset commented 6 years ago

It seems you can only get journals when using getIssueById. It seems to be a limitation of the redmine rest api: see Redmine Issues API & Redmine Issue by id API.

Benoit-Besnier commented 6 years ago

You're right, thank you for your answer.