Adding a comment
Use this request to add a comment to an issue.
Request format
Before making the request, get permission to access the API.
To add a comment to an issue, use an HTTP POST
request. Provide the request parameter in the request body in JSON format:
POST /v2/issues/<issue_ID_or_key>/comments
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID: <organization ID>
{
"text": "<comment_text>"
}
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 |
---|---|---|
isAddToFollowers | Add the user who made the comment to followers (by default, true ). |
Logical |
Request body parameters
Required parameters
Parameter | Value | Data type |
---|---|---|
text | Comment on the issue. | String |
Additional parameters
Parameter | Value | Data type |
---|---|---|
attachmentIds | List of attachment IDs. | Array of strings |
summonees | IDs or usernames of invited users. | Array of objects or strings |
maillistSummonees | List of mailing lists mentioned in the comment. | Array of strings |
Response format
If the request is successful, the API returns a response with code 201 Created
.
The response body contains information about the added comment in JSON format.
[
{
"self" : "https://https://api.tracker.yandex.net/v2/issues/TREK-1/comments/626",
"id" : 626,
"longId" : "5fa15a24ac894475********",
"text" : "Comment text",
"createBody" : {
"self" : "https://https://api.tracker.yandex.net/v2/users/11********",
"id" : "11********",
"display" : "Ivan Ivanov"
},
"updateBody" : {
"self" : "https://https://api.tracker.yandex.net/v2/users/11********",
"id" : "11********",
"display" : "Ivan Ivanov"
},
"createdAt" : "2020-11-03T13:24:52.575+0000",
"updatedAt" : "2020-11-03T13:24:52.575+0000",
"summonees" : [
{
"self" : "https://https://api.tracker.yandex.net/v2/users/11********",
"id" : "11********",
"display" : "Ivan Ivanov"
}
],
"maillistSummonees" : [
{
"self" : "https://https://api.tracker.yandex.net/v2/maillists/usertest@test.ru",
"id" : "usertest@test.ru",
"display" : "Ivan's mailing list"
}
],
"version" : 1,
"type" : "standard",
"transport" : "internal"
}
]
Response parameters
Parameter | Description | Data type |
---|---|---|
self | Link to the comment. | String |
id | Comment ID. | Number |
longId | ID of the comment in string format. | String |
text | Comment on the issue. | String |
createdBy | Block with information about the user who added the comment. | Object |
updatedBy | Block with information about the user who edited the comment last. | Object |
createdAt | Comment creation date and time. | String |
updatedAt | Comment update date and time. | String |
summonees | Block with information about users who are invited in comments. | Object |
maillistsummonees | Block with information about mailing lists mentioned in comments. | Object |
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 |
summonees
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 |
maillistsummonees
object fields
Parameter | Description | Data type |
---|---|---|
self | Link to the mailing list. | String |
id | Mailing list address. | String |
display | Mailing list 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.