Create link API call fails if called based on documentation
Summary
When attempting to create Issue Links via the provided API on github.com it fails. I have tried the way that it is currently documented in the "Gitlab.com" version as wel as "12.5" documentation version.
The docs I used are here: https://docs.gitlab.com/ee/api/issue_links.html https://docs.gitlab.com/12.5/ee/api/issue_links.html
Steps to reproduce
I tried this exact call on my GitLab repository:
Gitlab.com Version
curl --request POST --header "PRIVATE-TOKEN: xxxxxx" https://gitlab.com/api/v4/projects/12192464/issues/1859/links/12192464/1828
Response: {"error":"404 Not Found"}
12.5 Version
curl --request POST --header "PRIVATE-TOKEN: xxxxxx" https://gitlab.com/api/v4/projects/12192464/issues/1859/links?target_project_id=12192464&target_issue_iid=1828
Response: {"error":"target_issue_iid is missing"}
To reproduce with test data you should update the above to use valid issue and project ids.
Example Project
What is the expected correct behavior?
I figured out how the API actually works via trial and error. This call works:
curl --request POST --header "PRIVATE-TOKEN: XXXXXXX" https://gitlab.com/api/v4/projects/12192464/issues/1859/links?target_project_id=12192464 -d "target_issue_iid=1828"
It appears you need to have target_issue_iid as data but not as a parameter.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com.
Results of GitLab environment info
Possible fixes
Fix the documentation or fix the API to work as the documentation states. One or the other.