Allow passing an epic when creating issue via API
Problem to solve
Sometimes you want to create a new issue and immediately it to an epic via the API (see https://gitlab.com/gitlab-org/gitlab-ee/issues/5419 for an example).
Currently we need two requests:
- Create the issue (https://docs.gitlab.com/ee/api/issues.html#new-issue)
- Add issue to epic (https://docs.gitlab.com/ee/api/epic_issues.html#assign-an-issue-to-the-epic)
If 1. succeeds but 2. fails, we end up with a newly created issue that is not linked to the epic. A consumer of the API would then need to delete the issue (which can fail, too) or retry creating the epic (which can fail again).
Intended users
- mainly Developers
- everybody who uses Epics indirectly
Proposal
Add an epic_iid
parameter to https://docs.gitlab.com/ee/api/issues.html#new-issue. That way we only need one request for creating the issue.
Permissions and Security
Using the parameter requires permission to see the epic.
Documentation
https://docs.gitlab.com/ee/api/issues.html#new-issue needs update
Testing
ee/spec/requests/api/issues_spec.rb
needs additional tests
What does success look like, and how can we measure that?
Issue with epic can be created with only one request.
What is the type of buyer?
Everyone who buys epics.