track and report merge request IDs in commit history as a discrete field in the APIs

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Description

merge commits that are returned from the API should return the merge request ID as a discrete field, instead of being embedded in the message value.

API: GET /projects/:id/repository/commits/:sha

Returns an example JSON fragment for merge commits: "message": "Merge branch 'example' into 'master'\n\nChange the things\n\nSee merge request !123"

The problem is that I must string parse for the string \n\nSee merge request !\d+ to get the merge request number. It would be much less error prone if the API returned an optional field for that "merge_request" number

Proposal

If a commit came from a merge request, in addition to including the existing human readable message, include a field in the JSON response called merge_request containing the merge request number.

Links / references

https://gitlab.com/help/api/commits.md#get-a-single-commit

Edited Jun 18, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading