Importing comments

Use this request to import issue comments into Tracker.

POST

https://api.tracker.yandex.net/v3/issues/<issue_ID>/comments/_import

Before executing the request, make sure the user has permission to edit the issue into which you want to import the comments.

Query format

To import a comment, use an HTTP POST request. Comment parameters are passed in the request body in JSON format:

POST /v3/issues/<issue_ID>/comments/_import
Host: api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID or X-Cloud-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.

  • Authorization: Authorization token about these formats:

    • OAuth <OAuth_token>: For authorization using the OAuth 2.0 protocol. Learn more

    • Bearer <IAM_token>: For authorization using an IAM token, if a Yandex Cloud Organization organization is linked to Tracker. Learn more

  • X-Org-ID or X-Cloud-Org-ID: Organization ID.

    • Use the X-Org-ID header if a Tracker organization is linked to Yandex 360 for Business.

    • Use the X-Cloud-Org-ID header if a Tracker organization is linked to Yandex Cloud Organization.

    To get the organization ID, go to AdministrationOrganizations and copy the value from the ID field.

Resource
Parameter Description Data type
<issue_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.
  • String for the username
  • Number for the ID

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.
  • String for the username
  • Number for the ID

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://api.tracker.yandex.net/v3/issues/JUNE-2/comments/9849****",
        "id": 9849****,
        "longId" : "5fa15a24ac894475********",
        "text": "Comment",
        "createdBy": {
            "self": "https://api.tracker.yandex.net/v3/users/11********",
            "id": "11********",
            "display": "Ivan Ivanov"
        },
        "updatedBy": {
            "self": "https://api.tracker.yandex.net/v3/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 Map item
updatedBy Object with information about the last user to have updated the comment Map item
createdAt Comment creation date and time in the format:
YYYY-MM-DDThh:mm:ss.sss±hhmm
String
updatedAt Comment update date and time in the format:
YYYY-MM-DDThh:mm:ss.sss±hhmm
String
version Comment version. Each update increases the comment's version number. Number
type Comment type:
  • standard: Comment sent via the Tracker interface.
  • incoming: Comment created from an incoming message.
  • outcoming: Comment created from an outgoing message.
String
transport Method of adding a comment:
  • internal: Via the Tracker interface.
  • email: Via email.
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
You are not authorized 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 again later.
503
The API service is temporarily unavailable.