Add Attachment

POST {{baseUrl}}/rest/api/3/issue/:issueIdOrKey/attachments

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/3/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:

Request Body

[{"name"=>"0", "value"=>"<", "datatype"=>"string"}, {"name"=>"1", "value"=>"b", "datatype"=>"string"}, {"name"=>"2", "value"=>"i", "datatype"=>"string"}, {"name"=>"3", "value"=>"n", "datatype"=>"string"}, {"name"=>"4", "value"=>"a", "datatype"=>"string"}, {"name"=>"5", "value"=>"r", "datatype"=>"string"}, {"name"=>"6", "value"=>"y", "datatype"=>"string"}, {"name"=>"7", "value"=>">", "datatype"=>"string"}]

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

[{&quot;self&quot;:&quot;https://your-domain.atlassian.net/rest/api/3/attachments/10000&quot;,&quot;id&quot;:&quot;10001&quot;,&quot;filename&quot;:&quot;picture.jpg&quot;,&quot;author&quot;:{&quot;self&quot;:&quot;https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g&quot;,&quot;accountId&quot;:&quot;5b10a2844c20165700ede21g&quot;,&quot;emailAddress&quot;:&quot;mia@example.com&quot;,&quot;avatarUrls&quot;:{&quot;48x48&quot;:&quot;https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48\u0026s=48&quot;,&quot;24x24&quot;:&quot;https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24\u0026s=24&quot;,&quot;16x16&quot;:&quot;https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16\u0026s=16&quot;,&quot;32x32&quot;:&quot;https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32\u0026s=32&quot;},&quot;displayName&quot;:&quot;Mia Krystof&quot;,&quot;active&quot;:true,&quot;timeZone&quot;:&quot;Australia/Sydney&quot;},&quot;created&quot;:&quot;2020-12-17T01:45:44.477+0000&quot;,&quot;size&quot;:23123,&quot;mimeType&quot;:&quot;image/jpeg&quot;,&quot;content&quot;:&quot;https://your-domain.atlassian.net/secure/attachments/10000/picture.jpg&quot;,&quot;thumbnail&quot;:&quot;https://your-domain.atlassian.net/secure/thumbnail/10000/picture.jpg&quot;},{&quot;self&quot;:&quot;https://your-domain.atlassian.net/rest/api/3/attachments/10001&quot;,&quot;filename&quot;:&quot;dbeuglog.txt&quot;,&quot;author&quot;:{&quot;self&quot;:&quot;https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g&quot;,&quot;accountId&quot;:&quot;5b10a2844c20165700ede21g&quot;,&quot;emailAddress&quot;:&quot;mia@example.com&quot;,&quot;avatarUrls&quot;:{&quot;48x48&quot;:&quot;https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48\u0026s=48&quot;,&quot;24x24&quot;:&quot;https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24\u0026s=24&quot;,&quot;16x16&quot;:&quot;https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16\u0026s=16&quot;,&quot;32x32&quot;:&quot;https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32\u0026s=32&quot;},&quot;displayName&quot;:&quot;Mia Krystof&quot;,&quot;active&quot;:true,&quot;timeZone&quot;:&quot;Australia/Sydney&quot;},&quot;created&quot;:&quot;2020-12-17T01:45:44.477+0000&quot;,&quot;size&quot;:2460,&quot;mimeType&quot;:&quot;text/plain&quot;,&quot;content&quot;:&quot;https://your-domain.atlassian.net/secure/attachments/10001/dbeuglog.txt&quot;}]