Hello,
I am trying to upload an attachment to a Jira issue using the REST API using a third party tool, as the server documentation does not provide the method to perform this action, I used the cloud method which works fine on a separate instance.
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-attachments/#api-rest-api-2-issue-issueidorkey-attachments-post
I receive a 200 response but an empty json.
Here is the sent HTTP request:
POST
https://myserverinstance/rest/api/2/issue/CN105TC-307/attachments
HTTPS/1.1
Authorization: Basic amlyYWl2YWxxxxxxxxxxxxxxxx
Accept: application/json
X-Atlassian-Token: no-check
Content-Type: multipart/form-data; boundary=---------------------------8dc01469ad1d7bf
Host: myserverinstance
Content-Length: 243881
Expect: 100-continue
Accept-Encoding: gzip, deflate
-----------------------------8dc01469ad1d7bf
Content-Disposition: form-data; name="VPN.png"; filename="VPN.png"
Content-Type: image/png
< binary_file>
-----------------------------8dc01469ad1d7bf--
AND the response from Jira.
HTTPS/1.1 200 OK
X-AREQUESTID: 689x48707x1
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: frame-ancestors 'self'
X-ASEN: SEN-15xxxxx
X-Seraph-LoginReason: OK
X-ASESSIONID: 83kv3d
X-AUSERNAME: myuser
Content-Encoding:
Vary: User-Agent
Cache-Control: no-cache, no-store, no-transform
Content-Type: application/json;charset=UTF-8
Date: Wed, 20 Dec 2023 10:29:12 GMT
Server: Apache/2.4.39 (Win64) OpenSSL/1.1.1b
Transfer-Encoding: chunked
[]
Of course the attachment does not upload on the issue.
What could be the cause of the attachment not uploading and of that weird response?
Best.
This server version doc should help.
Thanks, that is exactly what I am using but the response is empty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.