---
title: "Create comment with attachment"
method: POST
path: "/rest/servicedeskapi/request/{issueIdOrKey}/attachment"
tags: ["Request"]
---

# Create comment with attachment

`POST /rest/servicedeskapi/request/{issueIdOrKey}/attachment`

This method creates a comment on a customer request using one or more attachment files (uploaded using [servicedeskapi/servicedesk/\{serviceDeskId\}/attachTemporaryFile](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-servicedesk/#api-rest-servicedeskapi-servicedesk-servicedeskid-attachtemporaryfile-post)), with the visibility set by `public`. See

 *  GET [servicedeskapi/request/\{issueIdOrKey\}/attachment](./#api-rest-servicedeskapi-request-issueidorkey-attachment-get)
 *  GET [servicedeskapi/request/\{issueIdOrKey\}/comment/\{commentId\}/attachment](./#api-rest-servicedeskapi-request-issueidorkey-comment-commentid-attachment-get)

**[Permissions](#permissions) required**: Permission to add an attachment.

**Request limitations**: Customers can set public visibility only.

## Path parameters

- `issueIdOrKey` string, required

## Request body

- AttachmentCreateDTO
  - `additionalComment` AdditionalCommentDTO
    - `body` string — Content of the comment.
  - `public` boolean — Controls whether the comment and its attachments are visible to customers
  - `temporaryAttachmentIds` string[] — List of IDs for the temporary attachments to be added to the customer request.

## Response `201`

Returns the attachments and comment.

- AttachmentCreateResultDTO
  - `attachments` PagedDTOAttachmentDTO
    - `_expands` string[]
    - `_links` PagedLinkDTO
      - `base` string, uri — Base URL for the REST API calls.
      - `context` string
      - `next` string, uri — REST API URL for the next page, if there is one.
      - `prev` string, uri — REST API URL for the previous page, if there is one.
      - `self` string, uri — REST API URL for the current page.
    - `isLastPage` boolean — Indicates if this is the last page of records (true) or not (false).
    - `limit` integer — Number of items to be returned per page, up to the maximum set for these objects in the current implementation.
    - `size` integer — Number of items returned in the page.
    - `start` integer — Index of the first item returned in the page.
    - `values` AttachmentDTO[] — Details of the items included in the page.
      - `_links` AttachmentLinkDTO
        - `content` string, uri — URL for the attachment.
        - `jiraRest` string, uri — REST API URL for the attachment
        - `self` string, uri
        - `thumbnail` string, uri — URL for the attachment's thumbnail image.
      - `author` UserDTO
        - `_links` UserLinkDTO
          - `avatarUrls` object — Links to the various sizes of the customer's avatar. Note that this property is deprecated, and will be removed in future versions.
          - `jiraRest` string, uri — REST API URL for the customer.
          - `self` string, uri
        - `accountId` string — The accountId of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*.
        - `active` boolean — Indicates if the customer is active (true) or inactive (false)
        - `displayName` string — Customer's name for display in a UI. Depending on the customer’s privacy settings, this may return an alternative value.
        - `emailAddress` string — Customer's email address. Depending on the customer’s privacy settings, this may be returned as null.
        - `key` string — This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details.
        - `name` string — This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details.
        - `timeZone` string — Customer time zone. Depending on the customer’s privacy settings, this may be returned as null.
      - `created` DateDTO
        - `epochMillis` integer — Date as the number of milliseconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), 1 January 1970.
        - `friendly` string — Date in a user-friendly text format.
        - `iso8601` string — Date in ISO8601 format.
        - `jira` string — Date in the format used in the Jira REST APIs, which is ISO8601 format but extended with milliseconds. For example, 2016-09-28T23:08:32.097+1000.
      - `filename` string — Filename of the item attached.
      - `mimeType` string — MIME type of the attachment.
      - `size` integer — Size of the attachment in bytes.
  - `comment` CommentDTO
    - `_expands` string[] — List of items that can be expanded in the response by specifying the expand query parameter.
    - `_links` SelfLinkDTO
      - `self` string, uri
    - `attachments` PagedDTOAttachmentDTO
      - `_expands` string[]
      - `_links` PagedLinkDTO
        - `base` string, uri — Base URL for the REST API calls.
        - `context` string
        - `next` string, uri — REST API URL for the next page, if there is one.
        - `prev` string, uri — REST API URL for the previous page, if there is one.
        - `self` string, uri — REST API URL for the current page.
      - `isLastPage` boolean — Indicates if this is the last page of records (true) or not (false).
      - `limit` integer — Number of items to be returned per page, up to the maximum set for these objects in the current implementation.
      - `size` integer — Number of items returned in the page.
      - `start` integer — Index of the first item returned in the page.
      - `values` AttachmentDTO[] — Details of the items included in the page.
        - `_links` AttachmentLinkDTO
          - `content` string, uri — URL for the attachment.
          - `jiraRest` string, uri — REST API URL for the attachment
          - `self` string, uri
          - `thumbnail` string, uri — URL for the attachment's thumbnail image.
        - `author` UserDTO
          - `_links` UserLinkDTO
            - `avatarUrls` object — Links to the various sizes of the customer's avatar. Note that this property is deprecated, and will be removed in future versions.
            - `jiraRest` string, uri — REST API URL for the customer.
            - `self` string, uri
          - `accountId` string — The accountId of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*.
          - `active` boolean — Indicates if the customer is active (true) or inactive (false)
          - `displayName` string — Customer's name for display in a UI. Depending on the customer’s privacy settings, this may return an alternative value.
          - `emailAddress` string — Customer's email address. Depending on the customer’s privacy settings, this may be returned as null.
          - `key` string — This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details.
          - `name` string — This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details.
          - `timeZone` string — Customer time zone. Depending on the customer’s privacy settings, this may be returned as null.
        - `created` DateDTO
          - `epochMillis` integer — Date as the number of milliseconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), 1 January 1970.
          - `friendly` string — Date in a user-friendly text format.
          - `iso8601` string — Date in ISO8601 format.
          - `jira` string — Date in the format used in the Jira REST APIs, which is ISO8601 format but extended with milliseconds. For example, 2016-09-28T23:08:32.097+1000.
        - `filename` string — Filename of the item attached.
        - `mimeType` string — MIME type of the attachment.
        - `size` integer — Size of the attachment in bytes.
    - `author` UserDTO
      - `_links` UserLinkDTO
        - `avatarUrls` object — Links to the various sizes of the customer's avatar. Note that this property is deprecated, and will be removed in future versions.
        - `jiraRest` string, uri — REST API URL for the customer.
        - `self` string, uri
      - `accountId` string — The accountId of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*.
      - `active` boolean — Indicates if the customer is active (true) or inactive (false)
      - `displayName` string — Customer's name for display in a UI. Depending on the customer’s privacy settings, this may return an alternative value.
      - `emailAddress` string — Customer's email address. Depending on the customer’s privacy settings, this may be returned as null.
      - `key` string — This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details.
      - `name` string — This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details.
      - `timeZone` string — Customer time zone. Depending on the customer’s privacy settings, this may be returned as null.
    - `body` string — Content of the comment.
    - `created` DateDTO
      - `epochMillis` integer — Date as the number of milliseconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), 1 January 1970.
      - `friendly` string — Date in a user-friendly text format.
      - `iso8601` string — Date in ISO8601 format.
      - `jira` string — Date in the format used in the Jira REST APIs, which is ISO8601 format but extended with milliseconds. For example, 2016-09-28T23:08:32.097+1000.
    - `id` string — ID of the comment.
    - `public` boolean — Indicates whether the comment is public (true) or private/internal (false).
    - `renderedBody` RenderedValueDTO
      - `html` string

## Other responses

- `400` — Returned if the HTTP request is invalid, including missing the required `public` field or list of temporary file IDs, or if the temporary files have expired.
- `401` — Returned if the user is not logged in.
- `403` — Returned if the user does not have permission to complete this request.
- `404` — Returned if the customer request does not exist.
- `500` — Internal Server Error.

---

[API](https://skmtc.net/atlassian/apis/service-management-public-rest-api.md) · [All operations](https://skmtc.net/atlassian/apis/service-management-public-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/service-management-public-rest-api/versions/0c91941a1ff9/schema)
