Module issue_attachments_api

Source

Enums§

AddAttachmentError
struct for typed errors of method add_attachment
ExpandAttachmentForHumansError
struct for typed errors of method expand_attachment_for_humans
ExpandAttachmentForMachinesError
struct for typed errors of method expand_attachment_for_machines
GetAttachmentError
struct for typed errors of method get_attachment
GetAttachmentMetaError
struct for typed errors of method get_attachment_meta
RemoveAttachmentError
struct for typed errors of method remove_attachment

Functions§

add_attachment
Adds one or more attachments to an issue. Attachments are posted as multipart/form-data (RFC 1867). Note that: * The request must have a X-Atlassian-Token: no-check header, if not it is blocked. See Special headers for more information. * The name of the multipart/form-data parameter that contains the attachments must be file. The following example uploads a file called myfile.txt to the issue TEST-123: curl -D- -u admin:admin -X POST -H \"X-Atlassian-Token: no-check\" -F \"file=@myfile.txt\" https://your-domain.atlassian.net/rest/api/2/issue/TEST-123/attachments Tip: Use a client library. Many client libraries have classes for handling multipart POST operations. For example, in Java, the Apache HTTP Components library provides a MultiPartEntity class for multipart POST operations. This operation can be accessed anonymously. Permissions required: * Browse Projects and Create attachments project permission for the project that the issue is in. * If issue-level security is configured, issue-level security permission to view the issue.
expand_attachment_for_humans
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.
expand_attachment_for_machines
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.
get_attachment
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.
get_attachment_meta
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.
remove_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.