Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Making a `multipart/form-data` request in Jira Automation

Chris Bonnar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Oct 01, 2023

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.

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 28, 2023

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events