Skip to content

Fix milestone_id=0 not clearing milestone for issue PUT API

euko requested to merge 407125-fix-issue-put-api-milestone into master

What does this MR do and why?

  • Fixes the bug: the issue PUT API does not clear the milestone attribute of an issue.

The cause of the bug is described in terraform-provider-gitlab#1447 (comment 1350664250).

How to validate and test the fix?

  1. Visit a project - note its id.
  2. Create an issue - note its internal iid.
  3. Create a milestone and assign the issue to the milestone.

Execute the curl command shown here to clear the milestone attribute for the issue.

curl --request PUT --header "PRIVATE-TOKEN: <API TOKEN>" "http://127.0.0.1:3000/api/v4/projects/<project id>/issues/<issue iid>?milestone_id=0" 

Visit the issue page to see that the issue is not assigned to any milestone.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #407125 (closed)

Edited by euko

Merge request reports

Loading