In a workflow transition I have a screen with an “attach file” input. In the post-function I want to access the attached file (if any) and create another issue with this file as attachment.
I tried to achieve this via the ServletActionContext.getRequest() but I can’t seem to get the uploaded file this way. The HttpServletRequest does not have the getPart() function.
Is there an official way to access attached files from post-functions?
Many thanks in advance
Thanks to this answer from Naykipap I found a working solution. Here’s what I came up with:
Important: the script has to be executed after the issue is saved to db. Else there is no changeItems in the transientVars and/or the attachment is not saved to disk. I moved it right down to the end of executions and it worked fine for me.