Gitlab API to Get Merge Request Comments and Reviews

Hi there, I have a problem regarding the Gitlab API

I’m doing an automation robot for my gitlab project which aims to automatically collect all the reviews and comments of the recent Merge Requests, and so far I have gone through the Gitlab Merge Request API and there seems to be no related one. Anyone has a good advice on this or has had the same problem?

Thanks for taking the time to be thorough in your request, it really helps! :blush:

Hi,

According to merge request API docs: Merge requests API | GitLab

Comments are done by the notes API command, so:

https://docs.gitlab.com/ee/api/notes.html#merge-requests

hope that is what you are looking for.

Hi, thanks for this, but actually I have tried notes api, as well as the discussions api, and I just find out both of them can only grab information about the merge request discussions and activities like when you comment on the whole MR, not for single line of code. However, generally we do code review line by line and leave comments to some lines of codes, and this action seems to be unavailable to these 2 APIs :sob: .

Have you tried to get comments for some pieces of code, not for the entire MR? Any other suggestions?