Sign in or sign up before continuing. Don't have an account yet? Register now to get started.
Add mentions_issues to Merge Request API
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=33166)
</details>
<!--IssueSummary end-->
### Problem to solve
Teams tracking issue references within Merge Requests have no programmatic way through the API to retrieve issues mentioned (but not closed by) a merge request.
### Intended users
Developers
### Further details
Adding an additional end-point shouldn't affect performance of other end-points, and the merge_request model already has the query built.
### Proposal
Patch for lib/api/merge_requests.rb
```
478,489d477
< get ':id/merge_requests/:merge_request_iid/mentions_issues' do
< merge_request = find_merge_request_with_access(params[:merge_request_iid])
< issues = ::Kaminari.paginate_array(merge_request.issues_mentioned_but_not_closing(current_user))
< issues = paginate(issues)
<
< external_issues, internal_issues = issues.partition { |issue| issue.is_a?(ExternalIssue) }
<
< data = Entities::IssueBasic.represent(internal_issues, current_user: current_user)
< data += Entities::ExternalIssue.represent(external_issues, current_user: current_user)
<
< data.as_json
< end
```
### Permissions and Security
No permission changes
### Documentation
MR API documentation will need to be updated with new end-point.
### Testing
Unknown
### What does success look like, and how can we measure that?
Unknown
### What is the type of buyer?
Unknown
### Links / references
issue