Import comments
Written by
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>/comments/_import
Host: https://api.tracker.yandex.net
Authorization: OAuth <token>
X-Org-ID: <organization ID>
{
"text": "Test",
"createdAt": "2017-08-29T12:34:41.740+0000",
"createdBy": 1110000000011111
}
Headers
-
Host
API host address:
https://api.tracker.yandex.net
-
Authorization
OAuth token in
OAuth <token value>
format. For example:OAuth 0c4181a7c2cf4521964a72ff57a34a07
-
X-Org-ID
Organization ID.
Resource
Parameter | Description | Data type |
---|---|---|
<issues-id> | 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
Request executed successfully
Request failed
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://api.tracker.yandex.net/v2/issues/JUNE-2/comments/9849018",
"id": 9849018,
"longId" : "5fa15a24ac894475dd14ff07",
"text": "Comment",
"createdBy": {
"self": "https://api.tracker.yandex.net/v2/users/1120000000049224",
"id": "<employee ID>",
"display": "<employee name displayed>"
},
"updatedBy": {
"self": "https://api.tracker.yandex.net/v2/users/1120000000049224",
"id": "<employee ID>",
"display": "<employee name displayed>"
},
"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 user who added the comment. | Object |
updatedBy | Object with information about the user who edited the comment last. | Object |
createdAt | Comment creation date and time in YYYY-MM-DDThh:mm:ss.sss±hhmm format |
String |
updatedAt | Comment update date and time.YYYY-MM-DDThh:mm:ss.sss±hhmm |
String |
version | Comment version. Each change to the comment increases its version number. | Number |
type | Comment type:
|
String |
transport | Method of adding a comment:
|
String |
Object fields createdBy
Parameter | Description | Data type |
---|---|---|
self | Link to the user. | String |
id | User ID. | String |
display | User's name displayed. | String |
Object fields updatedBy
Parameter | Description | Data type |
---|---|---|
self | Link to the user. | String |
id | User ID. | String |
display | User's name displayed. | String |
If a request fails, the response message contains details of the errors encountered:
- 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.