Get issue comments
Use this request to get a list of comments on an issue.
By default, the request returns only the first page showing 50 comments. If there are more than 50 comments, use paginated output.
Request format
Before making a request, get permission to access the API.
To get a list of comments, use an HTTP GET
request:
GET /v2/issues/<issue_ID_or_key>/comments
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID: <organization ID>
Headers
-
Host
Address of the node that provides the API:
https://api.tracker.yandex.net
-
Authorization
OAuth token in
OAuth <OAuth_token>
format, e.g.:OAuth 0c4181a7c2cf4521964a72ff********
-
X-Org-ID or X-Cloud-Org-ID
Organization ID. You can find it out on the Tracker organizations page
.- If a Yandex 360 for Business organization is the only one linked to Tracker, the
X-Org-ID
header is used. - If a Yandex Cloud Organization organization is the only one linked to Tracker, the
X-Cloud-Org-ID
header is used. - If both Yandex 360 for Business and Yandex Cloud Organization organizations are linked to Tracker at the same time, the
X-Org-ID
header and the Yandex 360 for Business organization ID are used.
- If a Yandex 360 for Business organization is the only one linked to Tracker, the
Resource
Parameter | Description | Data type |
---|---|---|
<issue_key_or_ID> | ID or key of the current issue. | String |
Request parameters
Additional parameters
Parameter | Description | Data type |
---|---|---|
expand | Additional fields to include in the response:
|
String |
Request for comments on a single issue:
An HTTP GET method is used.
GET /v2/issues/<issue_key>/comments?expand=all HTTP/1.1 Host: https://api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID: <organization ID>
Response format
If the request is successful, the API returns a response with code 200 OK
.
The response body contains a JSON array with information about comments:
[
{
"self": "https://https://api.tracker.yandex.net/v2/issues/JUNE-2/comments/98******",
"id": 98******,
"longId" : "5fa15a24ac894475********",
"text": "Comment **number one.**",
"textHtml": "<p>Comment <strong>number one.</strong></p>\n",
"attachments": [{ "self": "https://https://api.tracker.yandex.net/v2/issues/JUNE-3/attachments/1", "id": "1", "display": "Untitled.png" }],
"createdBy": {
"self": "https://https://api.tracker.yandex.net/v2/users/11********",
"id": "11********",
"display": "Ivan Ivanov"
},
"updatedBy": {
"self": "https://https://api.tracker.yandex.net/v2/users/11********",
"id": "11********",
"display": "Ivan Ivanov"
},
"createdAt": "2017-06-11T05:11:12.347+0000",
"updatedAt": "2017-06-11T05:11:12.347+0000",
"version": 1,
"type" : "standard",
"transport" : "internal"
},
...
]
Response parameters
Parameter | Description | Data type |
---|---|---|
self | Link to the comment object. | String |
id | Comment ID | Number |
longId | ID of the comment in string format. | String |
text | Text of the comment. | String |
textHtml | Comment HTML markup. | String |
attachments | Attached files. | String |
createdBy | Object with information about the author of the comment. | Object |
updatedBy | Object with information about the last user to have updated the comment. | Object |
createdAt | Comment creation date and time in the format: YYYY-MM-DDThh:mm:ss.sss±hhmm |
String |
updatedAt | Comment update date and time.YYYY-MM-DDThh:mm:ss.sss±hhmm |
String |
version | Comment version. Each update increases the comment's version number. | Number |
type | Comment type:
|
String |
transport | Method of adding a comment:
|
String |
createdBy
object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the user. | String |
id | User ID. | String |
display | User's name displayed. | String |
updatedBy
object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the user. | String |
id | User ID. | String |
display | User's name displayed. | String |
If the request is processed incorrectly, the API returns a response with an error code:
- 404
- The requested object was not found. You may have specified an invalid object ID or key.
Pagination of comments
For paginated results, use additional parameters in the request string:
GET /v2/issues/<issue_ID_or_key>/comments?perPage=<number_of_comments>&id=<comment_ID>
Where:
-
perPage
: Number of comments per page. -
id
: Comment'sid
parameter value after which the requested page will begin.
The links to the first and next pages are specified in the Link response header.
To learn about paginated results, see also Generic request format.