YouTrack InCloud 7.0 Help

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 http://localhost:8081/rest/import/CMN-1917/attachment?authorLogin=gorbachev&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 Server: Jetty(7.2.0.v20101020) <?xml version="1.0" encoding="UTF-8" standalone="yes"?><importReport><item imported="true"/></importReport>
Last modified: 29 September 2016