list-ticket-comments
dci list-ticket-comments <ticketId>
Returns all permitted comments on a support request. Customers and
service-account callers receive only public comments; private comment
bodies and attachments are excluded. Callers authenticated with DoiT
employee privileges receive both public and private comments, subject
to existing ticket authorization. Each comment includes public,
sourced from Zendesk: true means public and false means private
(internal). Missing visibility in legacy responses or snapshots means
unknown, not private. All comments are returned in a single response
(no pagination).
ticketId— The unique identifier of the support request.
Examples
# All comments on a ticket, in one response (customers see public comments only).
dci list-ticket-comments <ticket-id>
# Wrap long comment bodies instead of truncating them.
dci list-ticket-comments <ticket-id> -M wrap
# Author, timestamp, and text as JSON, for scripts.
dci list-ticket-comments <ticket-id> --fields author,created,body --output json
Output
OK - List of comments returned.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
comments | array of object | |
comments[].id | integer (int64) | Comment ID. |
comments[].body | string | The text content of the comment. |
comments[].public | boolean | Whether the comment is public. Always present in new responses, including false for private internal notes. GET reports Zendesk visibility; POST reports the effective visibility of the created comment. Missing metadata in legacy responses or snapshots means unknown and must not be interpreted as false. |
comments[].author | string | Stable comment-author attribution. User callers are represented by their verified email address; service-account callers use sa:<serviceAccountId>. |
comments[].created | integer (int64) | The time when this comment was created, in milliseconds since the epoch. |
comments[].attachments | array of object | File attachments on the comment. |
comments[].attachments[].id | integer (int64) | |
comments[].attachments[].file_name | string | |
comments[].attachments[].content_url | string |
Raw JSON schema
{
"type": "object",
"description": "Response containing all comments on a support ticket.",
"properties": {
"comments": {
"type": "array",
"items": {
"type": "object",
"description": "A comment on a support ticket.",
"required": [
"public"
],
"properties": {
"id": {
"type": "integer",
"description": "Comment ID.",
"format": "int64"
},
"body": {
"type": "string",
"description": "The text content of the comment."
},
"public": {
"type": "boolean",
"description": "Whether the comment is public. Always present in new responses,\nincluding false for private internal notes. GET reports Zendesk\nvisibility; POST reports the effective visibility of the created\ncomment. Missing metadata in legacy responses or snapshots means\nunknown and must not be interpreted as false."
},
"author": {
"type": "string",
"description": "Stable comment-author attribution. User callers are represented by\ntheir verified email address; service-account callers use\n`sa:<serviceAccountId>`."
},
"created": {
"type": "integer",
"description": "The time when this comment was created, in milliseconds since the epoch.",
"format": "int64"
},
"attachments": {
"type": "array",
"description": "File attachments on the comment.",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"file_name": {
"type": "string"
},
"content_url": {
"type": "string"
}
}
}
}
}
}
}
}
}
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
HTTP status to exit code mapping
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 404 | 20 | RESOURCE_NOT_FOUND | The requested resource does not exist. Check the identifier argument. |
| 502, 503 | 40 | API_SERVER_ERROR | The API failed to process the request. Retryable; contact DoiT support if it persists. |
Related
- create-ticket-comment — Add a comment
- get-ticket — Get a request
- list-tickets — List requests
- API reference: GET /support/v1/tickets/{ticketId}/comments
Aliases: id-of-ticket-comments-list