Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom endpoint to receive json string and save the json string a file

Joel Batac
Contributor
September 11, 2023

Hi,

 I'm trying to create a custom end where a json string will be the payload and save that paylod to a file. Is this possible?  

1 answer

Suggest an answer

Log in or Sign up to answer
1 vote
Nic Brough -Adaptavist-
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.
September 11, 2023

Hi Joel,

Absolutely!  There's two parts to this question. 

The really easy one is your REST endpoint, see https://library.adaptavist.com/entity/file-upload-to-rest-endpoint?tab=dataCenter 

The second one is about writing it to a file.  That's a bit more "fun" because you start having to think about where the file might go, what you do if you get duplicate names, what the upload structure is, and what you're actually going to do with the file.

But the same script does show you how to write to a temporary file and attach it to an issue, so you should be able to adapt that block of code to write to where you need it!

TAGS
AUG Leaders

Atlassian Community Events