Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8726311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:13:11+00:00 2026-06-13T08:13:11+00:00

In a workflow transition I have a screen with an attach file input. In

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:13:12+00:00Added an answer on June 13, 2026 at 8:13 am

    Thanks to this answer from Naykipap I found a working solution. Here’s what I came up with:

    // copy attachments uploaded in screen to new issue
    def changeItems = transientVars["changeItems"]
    def uploadChanges = changeItems.findAll { item -> item.getField() == "Attachment" && item.getFieldType() == "jira" }
    
    uploadChanges.each { uploadChange ->
      def Attachment attachment = attachmentManager.getAttachment(uploadChange.getTo()?.toLong())
      if (attachment) {
        def filePath = PathUtils.joinPaths(pathManager.attachmentPath, currentIssue.projectObject.key, currentIssue.key, attachment.id.toString())
        def atFile = new File(filePath)
        if (atFile.canRead()) {
            log.debug("Cloning attachment ${attachment.filename}")
            attachmentManager.createAttachmentCopySourceFile(atFile, attachment.filename, attachment.mimetype, attachment.author, newIssue, [:], attachment.created)
        }
      }
    }
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a workflow defined in SugarCRM defined on Tasks modules it works perfectly
I have an XML workflow where we're building an output document from an XML
I have a workflow running on an item in a list. The workflow has
I have hosted a state machine Worklow as a WCF service..And the workflow is
I have a workflow inside a Windows Service that is a loop that performs
In VS2010 WF4 workflow designer is there any way to get it to auto
My current situation is I have a custom workflow which include many statuses. For
I have a workflow that has a 'Prompt and Response' dialogue. I can run
I want to make a jira plugin that works like a workflow validator, but
I have two workflow services (state machines) that should cooperate and exchange information to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.