How to copy attachments to a newly created issue
Summary
It is easy to copy attachments to the newly created issue from the original issue (issue being transitioned) or other issues by using the Attachments field. However, special care is required if you want to copy new attachments from the original issue that have been added by the user on the transition screen. The reason for this is that some actions requested in your configuration have to be done after the issue is created and that requires that JIRA has fully registered the issue in the database and this is of the system defined post functions.
Solution
Here is the solution as articulated by Detlef Steinhäuser in - CSOT-150Getting issue details... STATUS :
- Set the issue status as the linked status of the required step under the destination workflow.
- Add a comment to the issue, if one is entered during a transition.
- Update the change history for an issue and store the issue in the database.
- Create subtasks as required.
- Re-index an issue to keep the indexes in sync with the database.
- Fire a Generic Event event that can be processed by the listeners.