Operations with Specific IssueAttachment
This resource lets you work with attachments in the specific issue.
Resource | /api/issues/{issueID}/attachments/{attachmentID} |
Returned entity | IssueAttachment. For the description of the entity attributes, see Supported Fields section. |
Supported methods |
IssueAttachment attributes
Represents a file that is attached to an issue or a comment.
This table describes attributes of the IssueAttachment
entity.
To receive an attribute in the response from server, specify it explicitly in the request parameter
fields
.To update an attribute, provide it in the body of a POST request.
Field | Type | Description |
---|---|---|
name | String | The name of the file. |
author | User | The user who attached the file to the issue. |
created | Long | The date and time when the attachment was created as a timestamp. |
updated | Long | The date and time the attachment was last updated as a timestamp. |
size | Long | The size of the attached file in bytes. |
extension | String | The extension that defines the file type. |
charset | String | Charset of the file. |
mimeType | String | Mime type of the file. |
metaData | String | The dimensions of an image file. For an image file, the value is |
draft | Boolean | If true, attachment is not yet published, otherwise false. |
removed | Boolean | If true, then attachment is considered to be removed. |
base64Content | String | The Data URI that represents the attachment with the following syntax:
data:[<media type>][;base64],<data>
For example:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
Can be null . |
url | String | URL of the file. |
visibility | Visibility | Access setting of the attachment. |
issue | Issue | The issue that the file is attached to. |
comment | IssueComment | The comment that the file is attached to. Returns |
thumbnailURL | String | URL of the attachment thumbnail. |
Read a Specific IssueAttachment
Read a specific attachment of the issue.
Required permissions
Requires read access to the issue, to which the attachment belongs.
If the attachment is added to a comment, access to this comment is also required.
If the attachment visibility is limited to specific groups or users, only users from this set and attachment author will be able to access the attachment. Override Visibility Restrictions permissions allows to override these limitations.
Request syntax
{attachmentID} | Database ID of the attachment. |
Request parameters
Parameter | Type | Description |
---|---|---|
fields | String | A list of IssueAttachment attributes that should be returned in the response. If no field is specified,only the |
Sample
Sample request
Sample response body
Update a Specific IssueAttachment
Update a specific attachment.
Required permissions
The author of the attachment can always update it. Otherwise, requires the Update Attachment permission.
Request syntax
{attachmentID} | Database ID of the attachment. |
Request parameters
Parameter | Type | Description |
---|---|---|
fields | String | A list of IssueAttachment attributes that should be returned in the response. If no field is specified,only the |
Sample
For an existing attachment, you can update only its name, visibility settings, and base64Content, if applicable. For this sample, we just re-name the attached image file.
Sample request
Sample request body
Sample response body
Delete a Specific IssueAttachment
Delete a specific attachment.
Required permissions
The author of the attachment can always delete it. Otherwise, requires Delete Attachment permission.
Request syntax
{attachmentID} | Database ID of the attachment. |
Request parameters
Parameter | Type | Description |
---|---|---|
fields | String | A list of IssueAttachment attributes that should be returned in the response. If no field is specified,only the |