taskadapter / redmine-java-api

Redmine Java API
Apache License 2.0
269 stars 162 forks source link

Update project trackers on redmine server #320

Closed javiertuya closed 5 years ago

javiertuya commented 5 years ago

Fixes #318.

Cause: Trackers are not updated in the server because RedmineJSONBuilder.writeProject sends a collection of Tracker objects to redmine server. However the api requires an array of tracker ids.

Solution: Writing trackers uses JsonOutput.addScalarArray wich replaces JsonOutput.addArrayIfNotNull.

But this still does not solve the problem, as in the case of a new project, an empty array of trackers would be sent to the server. Therefore any default tracker configured in the server would be overridden, and the project be created without trackers.

To avoid this, now the Project constructor does not initialize the storage for TRACKERS (initializations are made in project’s getters and setters that manage trackers). An additional method to clear all trackers has been added.