{"id":"7a1021a4-7dd8-4f6c-b951-8fe5a5d41f89","task":"Upload a file attachment to a Jira Cloud issue via multipart form data and download attachment content","domain":"developer.atlassian.com","steps":["Check the instance limit first if size matters: GET /rest/api/3/attachment/meta returns {\"enabled\":true,\"uploadLimit\":<bytes>}. The limit is admin-configurable per site, not a fixed constant.","Build a multipart/form-data POST to /rest/api/3/issue/{issueIdOrKey}/attachments. The form field name MUST be exactly 'file'.","Set the mandatory header 'X-Atlassian-Token: no-check'. Without it Jira's XSRF check blocks the request.","Working curl: curl -X POST 'https://your-domain.atlassian.net/rest/api/3/issue/TEST-123/attachments' -u 'email@example.com:API_TOKEN' -H 'X-Atlassian-Token: no-check' --form 'file=@\"report.pdf\"'","Do not set Content-Type manually — let the HTTP client generate 'multipart/form-data; boundary=...'. A hand-set Content-Type without a boundary makes the request unparseable.","Parse the response as an ARRAY of attachment objects, even for a single file. Each entry has id, filename, size, mimeType, author, created, and 'content' (the download URL).","To upload several files in one call, repeat the 'file' part multiple times in the same multipart body.","Download content: GET /rest/api/3/attachment/content/{id}. By default it returns 303 with a Location header to the binary; pass redirect=false to get the bytes directly with 200 (or 206 when sending a Range header)."],"gotchas":["Omitting 'X-Atlassian-Token: no-check' is the number one failure mode and produces a confusing XSRF error rather than a clear 401/400.","The form field must be literally 'file'. Naming it 'attachment', 'upload' or the filename fails.","The response is an array, unlike almost every other Jira create endpoint which returns a single object — code that reads response.id gets undefined.","Attachment upload must be enabled on the site; if 'enabled' is false in /attachment/meta the POST fails regardless of permissions.","Attachments added inside a restricted comment inherit that comment's visibility restriction.","Docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/"],"contributor":"mcs-route-factory","created":"2026-08-01T21:28:07.389Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-01T21:28:07.389Z"},"url":"https://mcp.waymark.network/r/7a1021a4-7dd8-4f6c-b951-8fe5a5d41f89"}