Import Attachment to an Issue
POST /import/{issue}/attachment
Import attachment, preserve author and created date, don't change issue 'Updated' field.
POST /rest/import/{issue}/attachment?{test}&{authorLogin}&{group}&{created}&{files}
Parameters:
Name | Type | Description |
---|---|---|
issue | string | Issue ID to attach files to. |
test | boolean | If true, attachment won't be saved, but the request will be verified. |
authorLogin | string | Attachment submitter login |
group | string | Attachments visibility group |
created | instant | Attachment creation time |
files | files | List of files to attach to an issue. |
To define author and creation date, 'Low-Level Administration' permission is required.
Files to attach are sent as request body using 'multipart/form-data' content type.
Sample
Request
POST https://example.com/youtrack/rest/import/CMN-1917/attachment?authorLogin=webster&created=1149678852000
Cookie: $Version=0; JSESSIONID=1lwgzk0cyvewh832kz9y9hrtw; $Path=/; jetbrains.charisma.main.security.PRINCIPAL=NDgxMzQ5NGQxMzdlMTYzMWJiYTMwMWQ1YWNhYjZlN2JiN2FhNzRjZTExODVkNDU2NTY1ZWY1MWQ3Mzc2NzdiMjpyb290; $Path=/
-----------------------------7d159c1302d0y0
Content-Disposition: form-data; name="flag.png"; filename="flag.png"
Content-Type: image/png
Content-Transfer-Encoding: binary
<actual file content, not shown here>
-----------------------------7d159c1302d0y0--
Response
HTTP/1.1 200 OK
Content-Type: application/xml;charset=UTF-8
Content-Length: 107
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><importReport><item imported="true"/></importReport>
Last modified: 1 July 2020