I have a custom HTML form on Confluence that allows users to enter information and automatically creates an issue on JIRA using the REST API. This works perfectly by making a POST to Confluence's jira-integration API:
[confluence-domain]/rest/jira-integration/1.0/issues?applicationId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
However, this doesn't work at all for attachments. According to the JIRA Cloud API documentation, this should be possible by making a multipart/form POST, with the 'X-Atlassian-Token: no-check' header to:
[jira-domain]/rest/api/2/{issueOrKey}/attachments
This does not work when at all when made through the jira-integration API, with the server returning a 415 Unsupported Media Type.
I've confirmed that i'm sending the correct HTTP request via Postman and curl, but both return the same 415, leading me to question whether or not this is actually possible with the REST API?
Here's the complete curl i'm using:
curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: no-check" -F "file=@B2B.png" 'https://[confluence-domain]/rest/jira-integration/1.0/issues?applicationId=ffbb9c48-84c6-318d-96fc-36722f84a9cf&path=https://[jira-domain]/rest/api/2/issue/TEST-2384/attachments'
And here's the server response:
HTTP/1.1 100 Continue
HTTP/1.1 415 Unsupported Media Type
Server: Apache-Coyote/1.1
X-ASEN: SEN-9445026
X-Confluence-Cluster-Node: 4bd404ad
X-Confluence-Cluster-Node-Name: confluence01
Set-Cookie: JSESSIONID=7F98DA97EAF0E414F802A885A288237C; Path=/; Secure; HttpOnly
X-Seraph-LoginReason: OK
X-AUSERNAME: admin
X-Content-Type-Options: nosniff
Content-Length: 0
Date: Sun, 09 Sep 2018 03:20:22 GMT
Connection: close
Do you have an exemple in vb or in c plsss ?
2weekends and i have try everythig, nothing works here...
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.