'How to get comments from gitlab?

Is it possible to get comments from issues on Gitlab? as I read official docs https://docs.gitlab.com/ee/api/issues.html comments are not included there.



Solution 1:[1]

In order to get the comments posted at an issue we will use the Gitlab API https://docs.gitlab.com/ee/api/discussions.html#list-project-issue-discussion-items

GET /projects/:id/issues/:issue_iid/discussions

By providing the project :id and the :issue_iid , the issue_iid in this case would be 2 enter image description here

By providing the following one liner we can get the comments and their metadata for a specific project and issue

curl -s  --header "PRIVATE-TOKEN: <access token>" https://gitlab.com/api/v4/projects/<project id>/issues/<issue_iid>/discussions | jq '.[].notes[0]'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tolis Gerodimos