Unassigne user from issue
kukukk opened this issue · comments
Hi,
I would like to unassigne a user from an issue but without assigning the issue to an another user.
It is possible to do it with a PUT request to issues/_issue_id_.json
endpint with the following body:
{
"issue": {
"assigned_to_id": ""
}
}
I tried the same with this client using the following code snippet:
$redmineClient->issue->update($issueId, [
'assigned_to_id' => ''
]);
But the sanitizeParams()
method eliminates the empty assigned_to_id
field.
So, my question is: how can I unassigne a user from an issue and leave the issue unassigned?
Hey @kburwieck You are right, this is a bug in AbstractApi::sanitizeParams()
.
I have created and tested a bugfix, but found that there is a bug in Redmine when the REST API is accessed as XML. See https://www.redmine.org/issues/33744
So for fixing this bug we would need to switch to JSON instead of XML for updating an issue.
As a workaround one could use this code to unassign a user from an issue:
$client->requestPut(
'/issues/' . $issueId . '.json',
'{"issue": {"assigned_to_id": ""}}'
);
I just released v2.2.0