I'm trying to reproduce a `multipart/form-data` request within Jira Automation. The request is a POST to the Confluence v1 API attachments endpoint, and I have called this successfully using Postman.
However, when running within Jira Automation, I'm receiving code 500: `java.lang.RuntimeException: org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly`.
Researching this error has sent me round in circles with variations of CRLF (or `\r\n`), and I have tried every permutation to no avail. This post looked particularly promising, pointing specifically to the new line before the last boundary - again I experimented to no avail.
The below is the exact request Postman is making for a very simple text file, as captured by Fiddler. I have lifted this exact text into the Jira Automation web request, configuring the same headers Postman is using.
----------------------------882762106784743758392779
Content-Disposition: form-data; name="file"; filename="New Text Document.txt"
Content-Type: text/plain
SampleTextContent
----------------------------882762106784743758392779
Content-Disposition: form-data; name="minorEdit"
1
----------------------------882762106784743758392779--
`Content-Type` header configured in Jira Automation is:
multipart/form-data; boundary=--------------------------882762106784743758392779
Where am I going wrong? TIA!
*Side note - I'm doing this because I want to automatically create a Confluence page which carries the same attachments as the Jira issue that triggered it. If anyone is aware of another way to do this, I'd welcome ideas.
Hi @Chris Bonnar @Fabian Ehrler
I am also trying to achieve the same. Have you got any solution for this?
Regards,
Jawad Haider
I'm afraid the project moved on and I abandoned what I was trying to do here - I didn't find any solution. Hopefully you do!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same here. Sorry.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks will create ticket with Atlassian support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you manage to get this resolved? I've probably the same challenge right now.
I'd like to get the attachment on issue1 and post it on issue2. Likewise, I get a message like this:
400 - CLIENT_ERROR Stream ended unexpectedly
Using: "Response: {{webResponse.status}} - {{webResponse.statusCategory}} {{webResponse.body}}" as a log action.
In my automation workflow, I've set up a "duplicate" post to a Postman mock server instance, so that I can see what happens (or at least sort of). Interestingly, this body I receive this way looks quite okay to me:
When I copy & paste this exact body, and execute the request from postman (same headers etc.), the upload is successful, and I'm able to see the attachment on the issue. Strange.
The Custom data that I'm posting looks something like this, btw:
--{{formBoundary}}
Content-Disposition: form-data; name="file"; filename="{{filename}}"
Content-Type: application/octet-stream
{{webResponse.body}}
--{{formBoundary}}--
Something seems to be still interacting with the body, or I'm overlooking something.
Regards,
Fabian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Chris Bonnar -- Welcome to the Atlassian Community!
As you appear to be on a paid, Jira license, you may want to work with your site admin to submit this one as a support ticket to Atlassian here: https://support.atlassian.com/contact/#/
In the meantime, you could also ask this one in the developer community here: https://community.developer.atlassian.com/
Kind regards,
Bill
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.