I can confirm this on Redmine 5.1, 6.0, 6.1 and 7.0. The behaviour depends on the request format.
I updated an issue that had assigned_to_id set and sent an empty value, then fetched the issue again. All requests returned 204 No Content. The result is the same on all four versions:
| Request body |
assigned_to_id |
XML <assigned_to_id></assigned_to_id> |
still assigned |
JSON {"assigned_to_id": ""} |
unassigned |
I also tested the following on Redmine 7.0.2 (an issue category was unassigned in every case):
| Request body |
Issue |
XML <assigned_to_id/> |
still assigned |
XML <assigned_to_id nil="true"/> |
still assigned |
JSON {"assigned_to_id": null} |
still assigned |
So an empty string in a JSON request is the only way to unassign an issue through the REST API, as noted above. XML requests (with an empty or nil value) and JSON null are silently ignored, and the response is still a successful 204, so the client cannot tell that nothing happened.
Workaround:
PUT /issues/1.json
Content-Type: application/json
{"issue": {"assigned_to_id": ""}}
A client-side fix using this workaround: php-redmine-api #512.