Copy Value From Other Field Post Function
Â
This is the documentation for JSU for Jira Server/Data Center. If you are using JSU on Jira Cloud, see our JSU Cloud documentation.
On this page: |
Description
The ‘Copy Value From Other Field’ post function copies the value of one field to another field. You can configure any number of source/destination field pairs. You can also use this post function to copy from/to comments. The copy operation can be performed within the same issue or to/from a related issue.
Configuration
You must specify the relation between the source and destination issues for the field to copy. Then you can add any number of field pairs to perform the copy operation.
Precondition
If you are using preconditions with a JSU post function, you can use the following options to define how the precondition is evaluated:
Ignore precondition (default): Every precondition is ignored which means that the post function will always be performed
True: Precondition must be true to execute a post function
False: Precondition must be false to execute a post function
Issue Relation
Perform As User
Copy Fields
See the note about supported field types below.
Position of the post functionÂ
Jira transitions include essential post functions that are executed in a specific order. When adding JSU post functions to a transition, it is important to position the post function with respect to the essential post functions.
‘Create’ transition
The ‘Create' transition is the first transition, which does not have a source status (only destination status - usually Open).
If you add the ‘Copy Value From Other Field’ post function to the ‘Create’ transition, you should generally position it before the ‘Creates the issue originally’ post function.
Specific field types
If the ‘Copy Value From Other Field’ post function applies to any of the following fields, position it after ‘Creates the issue originally’ and before ‘Re-index an issue to keep indexes in sync with the database’.
Watchers
Labels
*** new comment ***
Exception for Copy Value From Other Field used on the Create transition to populate value from linked issues
If you use the ‘Copy Value From Other Field’ post function in the ‘Create’ transition and you would like to copy values from a linked issue (Issue Linking: Issue in Transition = Source, Issue Linking: Issue in Transition = Destination, Parent / Sub-Task, Epic / Issue in Epic), the post function must be placed after 'Creates the issue originally'. An issue has to be first created, then a relation between these linked issues is established.
Any other transition (not ‘Create’)
Place the ‘Copy Value From Other Field’ post function anywhere before the "Update change history for an issue and store the issue in the database." post function.
Example
A workflow is configured so the ‘Resolve’ transition has the ‘Copy Value From Other Field' post function. The post function is configured to copy the value of the ‘Assignee’ field to the 'TextField’ field. If a user resolves an issue on this workflow, the value of the 'Assignee' field will be copied to the 'TextField' field after the issue is resolved.