Jira API Add attachment v3 params

I am trying to add attachment to a Jira issue by REST API POST Add attachment endpoint. It works OK, just documentation is confusing for me:

  • Where to specify additional Request body params like name, originalFilename, contentType, inputStream, … and what do they mean? I’ve tried them as other form-data params, after Content-Disposition: etc., but have seen no change in the attachment metadata.
    • E.g. Content-Disposition: form-data; name="file"; filename="hello.txt"; contentType="text/plain" does not work for content type.
  • Specifying Content-Type: after Content-Disposition: works, but is not documented.
    • E.g.
      Content-Disposition: form-data; name="file"; filename="hello.txt"
      Content-Type: text/plain
      
  • A bit off-topic question, since it’s possible to add multiple attachments by one request, is it also possible to delete multiple attachments by one request? By DEL Delete attachment it’s possible just one by one.

Thanks

Hi @OndejMedek ,

Its possible to add attachment via API :

API : {BaseJiraCloudURL}/rest/api/3/issue/TEST-1/attachments

**Payload : **

Body → **form-data →
KEY = file
VALUE = select file from your system

if you using curl Command then - **
$ curl --location --request POST “{BaseURL}/rest/api/3/issue/TEST-1/attachments”
-u “{EmailID}:{Token}”
-H “X-Atlassian-Token: no-check”
–form “file=@/c/Downloads/Text file.txt”

Its works . I tested on my system.

Thanks!!!

@NishantParaskar2 Yes, add attachment works for me. But when using additional request params from doc does not change the answer, see my first question. (While using undocumented “Content-Type” works).