Importing comments
Warning
This request can only be executed if the user has permission to edit the issue that comments are imported to.
Use this request to import to Tracker comments on issues.
Request format
To import a comment, use an HTTP POST
request. Comment parameters are passed in the request body in JSON format:
POST /v2/issues/<issue_ID_or_key>/comments/_import
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID: <organization ID>
{
"text": "Test",
"createdAt": "2017-08-29T12:34:41.740+0000",
"createdBy": 11********
}
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_ID_or_key> | Key of the issue to attach the file to. | String |
Request body parameters
Required parameters
Parameter | Description | Data type |
---|---|---|
text | Text of the comment, no more than 512,000 characters. | String |
createdAt | Comment creation date and time in YYYY-MM-DDThh:mm:ss.sss±hhmm format. You can specify any value in the interval from the issue's creation time to its latest update. |
String |
createdBy | Username or ID of the user who made the comment. |
|
Additional parameters
Parameter | Description | Data type |
---|---|---|
updatedAt | Date and time of the comment's last update in YYYY-MM-DDThh:mm:ss.sss±hhmm format. You can specify any value in the interval from the time of issue creation to the time it was last updated.The parameter is only used together with the updatedBy parameter. |
String |
updatedBy | Username or ID of the user who edited the comment last. The parameter is only used together with the updatedAt parameter. |
|
Response format
If the request is successful, the API returns a response with code 200 OK
.
The response body contains the parameters of the attached file in JSON format:
{
"self": "https://https://api.tracker.yandex.net/v2/issues/JUNE-2/comments/9849****",
"id": 9849****,
"longId" : "5fa15a24ac894475********",
"text": "Comment",
"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 |
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 | Link to the user. | String |
id | User ID. | String |
display | Displayed user name. | String |
updatedBy
object fields
Parameter | Description | Data type |
---|---|---|
self | Link to the user. | String |
id | User ID. | String |
display | Displayed user name. | String |
If the request is processed incorrectly, the API returns a message with error details:
- 400
- One or more request parameters have an invalid value.
- 403
- Insufficient rights to perform this action. You can check what rights you have in the Tracker interface. The same rights are required to perform an action via the API and interface.
- 404
- The requested object was not found. You may have specified an invalid object ID or key.
- 422
- JSON validation error, the request is rejected.
- 500
- Internal service error. Try resending your request in a few minutes.
- 503
- The API service is temporarily unavailable.