This is the documentation of JSU for Jira Server/Data Center. If you are using JSU on Jira Cloud, see our JSU Cloud documentation.
On this page: |
The 'Copy / Move Attachments' feature is available from JSU 2.9.0
Description
This post function will copy attachments from/to all related issues. A user defines which issue should be a source and which is a destination. Any number of attachments can be copied to the related issue/-s.
Configuration
Precondition
Copy attachment from/to any related issue
You have several options, which define which issue/s will be treated as source/destination for attachments.
Several of JSU's workflow modules provide the option to define the scope on some related issues.
For example, instead of copying attachments from one issue to another, you might choose to copy them from all linked issues to the issue in transition (e.g. to group all attachments within one issue)
Types of issue relations
Related issues will be found by one of the following Jira concepts:
Issue Link
You can define the link type to define which issues exactly will be affected by the operation.
Since JSU 2.2.0, we introduced the value ANY. The operation will be performed on any linked issues.Parent / Subtask
The related issue is either parent or subtask of each other.Epic / Issue in Epic
This is only applicable if you have Jira Software installed. The other issue is either the epic related by an epic link, or it is part of an epic.
Issue in transition
We use the term 'Issue in Transition' when we refer to the issue for which a workflow condition is checked, for which a workflow validator is examined, or for which a workflow post function is performed.
Or in other words, the issue which triggered a workflow condition/validator/post function to be executed.
Conditional copying attachments
Conditional copying attachment (controlled by custom field) is always checked only for the issue in transition, regardless of whether the issue in transition is a source or destination.
Source and destination
For example, the Copy Value From Other Field post function allows you to define the issue in transition as the source or destination of the copy operations, while you define the other end with an issue relation.
The field value will then be read from the source issue and written to the destination issue.
Other workflow modules do not have source and destination; you just define the issue relation, which will apply to that workflow module.
For example, Create a Linked Issue will create a new issue, and then connect it through an issue relation to the issue in transition.
Controlled by custom field
Here you have a checkbox custom field on the transition screen so that the user can control some of the functionality.
For example, a checkbox 'Copy Attachments' might be configured as a custom field that enables copying existing attachments. Only if it is ticked, all attachments will be copied. Typically this checkbox custom field won't appear on the normal issue screen. Instead of letting a user choose to copy/move the attachments, you can also configure it to either never or always copy them.
You can also choose 'Move Attachments added during Transition'. When a user adds some attachments on the transition screen of the source issue, it appears as if they added the attachments to all related issues.
Perform As User
When choosing a user account to run a post function, the account specified must have the appropriate permissions to perform the actions of the post function, for example, creating an issue or adding a comment. You can specify a different user account that owns the necessary permissions that acts only as a technical (impersonation), with broad permissions, but not used to log in to a Jira account as an individual.
If you don't specify a user here, the transition on the related issue is performed as the same user who triggered this post function on the origin issue by default. Therefore that user must have the necessary permissions on the related issue. In some setups, that user might not have the required permissions on the related issue or even access to the project of the related issue.
In combination with the User is in Any Users condition, you can hide a transition from all users other than the 'Perform As User' user.
Position of the post function
If you use 'Move Attachment' you must position the post function before 'Update change history for an issue and store the issue in the database. 'This post function can also be used in a combination with preconditions.
If you use ‘Move Attachments added during Transition' it is important that the 'Copy / Move Attachments' post function is before the Jira’s 'Update change history for an issue and store the issue in the database' post function.
In such case ‘Copy Move Attachments’ must be placed between ‘Update change history for an issue and store the issue in the database’ and 'Re-index an issue to keep indexes in sync with the database’.
Otherwise transition attachment will not be properly stored and it will be not attached to the current issue.
Existing attachments are not copied again
When an identical attachment (same file name and same content) already exists in the destination issue, it will not be copied again. This is the case for both, existing and transition attachments.