Skip to content

attachment

expand-for-humans

Get all metadata for an expanded attachment

Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported.

Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the attachment itself, such as the attachment's ID and name. Otherwise, use Get contents metadata for an expanded attachment, which only returns the metadata for the attachment's contents.

This operation can be accessed anonymously.

Permissions required: For the issue containing the attachment:

  • Browse projects project permission for the project that the issue is in.
  • If issue-level security is configured, issue-level security permission to view the issue.
  • If attachments are added in private comments, the comment-level restriction will be applied.

GET /rest/api/3/attachment/{id}/expand/human

FlagTypeRequiredDescription
--idstringYesThe ID of the attachment.

Example:

bash
jr attachment expand-for-humans --id <id>

expand-for-machines

Get contents metadata for an expanded attachment

Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is supported.

Use this operation if you are processing the data without presenting it to the user, as this operation only returns the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use Get all metadata for an expanded attachment which also returns the metadata for the attachment itself, such as the attachment's ID and name.

This operation can be accessed anonymously.

Permissions required: For the issue containing the attachment:

  • Browse projects project permission for the project that the issue is in.
  • If issue-level security is configured, issue-level security permission to view the issue.
  • If attachments are added in private comments, the comment-level restriction will be applied.

GET /rest/api/3/attachment/{id}/expand/raw

FlagTypeRequiredDescription
--idstringYesThe ID of the attachment.

Example:

bash
jr attachment expand-for-machines --id <id>

get

Get attachment metadata

Returns the metadata for an attachment. Note that the attachment itself is not returned.

This operation can be accessed anonymously.

Permissions required:

  • Browse projects project permission for the project that the issue is in.
  • If issue-level security is configured, issue-level security permission to view the issue.
  • If attachments are added in private comments, the comment-level restriction will be applied.

GET /rest/api/3/attachment/{id}

FlagTypeRequiredDescription
--idstringYesThe ID of the attachment.

Example:

bash
jr attachment get --id <id>

get-content

Get attachment content

Returns the contents of an attachment. A Range header can be set to define a range of bytes within the attachment to download. See the HTTP Range header standard for details.

To return a thumbnail of the attachment, use Get attachment thumbnail.

This operation can be accessed anonymously.

Permissions required: For the issue containing the attachment:

  • Browse projects project permission for the project that the issue is in.
  • If issue-level security is configured, issue-level security permission to view the issue.
  • If attachments are added in private comments, the comment-level restriction will be applied.

GET /rest/api/3/attachment/content/{id}

FlagTypeRequiredDescription
--idstringYesThe ID of the attachment.
--redirectstringNoWhether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can set this to false to avoid making multiple requests to download the attachment.

Example:

bash
jr attachment get-content --id <id>

get-meta

Get Jira attachment settings

Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed.

Note that there are also project permissions that restrict whether users can create and delete attachments.

This operation can be accessed anonymously.

Permissions required: None.

GET /rest/api/3/attachment/meta

Example:

bash
jr attachment get-meta

get-thumbnail

Get attachment thumbnail

Returns the thumbnail of an attachment.

To return the attachment contents, use Get attachment content.

This operation can be accessed anonymously.

Permissions required: For the issue containing the attachment:

  • Browse projects project permission for the project that the issue is in.
  • If issue-level security is configured, issue-level security permission to view the issue.
  • If attachments are added in private comments, the comment-level restriction will be applied.

GET /rest/api/3/attachment/thumbnail/{id}

FlagTypeRequiredDescription
--fallbackToDefaultstringNoWhether a default thumbnail is returned when the requested thumbnail is not found.
--heightstringNoThe maximum height to scale the thumbnail to.
--idstringYesThe ID of the attachment.
--redirectstringNoWhether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can set this to false to avoid making multiple requests to download the attachment.
--widthstringNoThe maximum width to scale the thumbnail to.

Example:

bash
jr attachment get-thumbnail --id <id>

remove

Delete attachment

Deletes an attachment from an issue.

This operation can be accessed anonymously.

Permissions required: For the project holding the issue containing the attachment:

  • Delete own attachments project permission to delete an attachment created by the calling user.
  • Delete all attachments project permission to delete an attachment created by any user.

DELETE /rest/api/3/attachment/{id}

FlagTypeRequiredDescription
--idstringYesThe ID of the attachment.

Example:

bash
jr attachment remove --id <id>