Closed akohlbecker closed 6 years ago
@akohlbecker thank you for reporting this. I do not actively work on this project anymore. if you can submit a PR with a fix that would be in line with the current architecture, I can review & merge.
closing since no one volunteered to work on this issue. in general, the API was not intended to erase fields (historical reasons). this can be implemented, but needs to be done in a backward-compatible manner , as a general solution for all fields, not just one
We have found today the same problem when I migrated from Redmine v3.1.2 (unset assignee_to_id from Redmine Java API worked fine) to v3.4.11 (assigned_to_id can't be unset by API). Our workaround has been to change the addIfSet method in the RedmineJSONBuilder class of the Redmine Java API. I share it for if this may help someone
private static void addIfSet(JSONWriter writer, String jsonKeyName, PropertyStorage storage, Property<?> property) throws JSONException {
if (storage.isPropertySet(property)) {
writer.key(jsonKeyName);
writer.value(storage.get(property) != null ? storage.get(property) : "");
}
}
This seems to work now on Redmine 4.1.0
with "assigned_to_id": ""
The
assigned_to_id
of an existing issue can not be unset:will cause the Transport to send a
null
value to the REST API:but Redmine (v.3.3.6) ignores this. The only value which causes the issue service to reset the
assigned_to_id
is an empty string: