Skip to end of banner
Go to start of banner

Copy Value From Other Field Post Function

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 55 Next »

This is the JSU for Jira Cloud documentation. If you are using JSU on Jira Server or on Jira Data Center, see our JSU Server/Data Center 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 either 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 from/to field pairs for the copy operation.

Configuration page for the Copy Value From Other Field post function.

Precondition

If you are using preconditions with a JSU post function, they can be evaluated in the following ways:

  • True (Precondition must be true to execute a post function)

  • False (Precondition must be false to execute a post function)

Setting options for JSU preconditions.

The precondition setting is available on our post function configuration pages, and it is set to True by default. You can learn more about our preconditions in Workflow Preconditions. See the Preconditions for Post Functions uses cases for examples.

Issue Relation

Most of JSU's workflow post functions have the option to define the scope of related issues. For example, instead of copying a field within an issue during a post function, you can copy it to a subtask.

A list of issue relation options in JSU post functions.

Types of issue relations

Related issues are identified by one of the following Jira concepts:

  • Issue link: You can choose the link type to define which issues will be modified by the operation. If the post function includes the link type is ANY option, the operation will be performed on any linked issues.

  • Parent / Sub-Task: The related issue is either the parent or a subtask.

  • Epic / Issue in Epic: The other issue is either an epic related to an epic link, or it is part of an epic. This is only applicable if you have Jira Software installed.

  • JQL: A JQL query will be executed to retrieve the issues the post function will modify. You can use some placeholders in the JQL query, which will be replaced with the current field values of the issue in transition. For tips on writing the JQL query, see JQL Reference or our JQL Use Cases for some examples.

Issue in transition

Issue in Transition refers 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; in other words, the issue that triggered a workflow condition/validator/post function to be executed.

Source and destination

For some post functions, you can choose whether the issue in transition serves as the source or the 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. In contrast, you define the other end with an issue relation. The field value is then read from the source issue and written to the destination issue. Other post functions do not have a source and destination; you simply define the issue relation that applies to the post function. For example, the Create a Linked Issue post function creates a new issue and then connects it through an issue relation to the issue in transition.

Related issues limitations

While we try to execute as many configurations as possible, there are some restrictions you should keep in mind.

  • Copy Value From Other Field post function: There should be only one source issue; otherwise, it is unclear from which issue the value should be read. The current implementation will simply select one of them and ignore the rest.

  • If you use the Create a Linked Issue post function to create a new subtask, you must also configure the post function to create the new issue as an issue type of a subtask. The target project must be the same as the one for the issue in transition.

Perform As User

When choosing a user account to run a post function, the specified user account must have the appropriate permissions to perform the actions, such as creating an issue or adding a comment.

If JSU determines that the specified user has insufficient permissions, it executes the rule using the JSU Add-on user. This is displayed in the Execution Log as a success and includes a warning.

JSU can’t determine if the specified user is missing necessary Jira global permissions. In this case, the rule runs using the specified user. If the run encounters a Jira error, it will fail. This is displayed in the Execution Log with a permission error.

The Perform as User options for JSU post functions.

JSU Add-On User (default)

The JSU Add-On User account is automatically added to an instance when JSU is installed and already has the required permissions to perform all actions across JSU post functions. If the permissions haven’t been manually removed from the JSU Add-On User, it should not impact its success as the Perform as User instead of another account.

If you don't specify a different option, the transition on the related issue is performed as the JSU Add-On User with its associated permissions. This option is useful for testing, and you can confirm the action in your issue activity.

When the JSU Add-On User makes changes to issues, you can see the changes in the Activity section of the issue:

Jira issue history showing an automation was run as the JSU add-on user.

Initiating User

The transition on the related issue is performed with the same user who triggered this post function on the origin issue. That user must have the necessary permissions on the related issue. In some restrictive setups, a user might not be allowed to perform the action or might not have permission to view the relevant project.

Choose user

Use this option to specify a different user account that has been granted the necessary permissions. Usually, this user account is assumed to be only technical (impersonation), with broad permissions, and not used by individuals to log into Jira. 

In combination with the Permission condition in native Jira, or the User Is In Any Users condition from JSU, you can hide a transition from all users that do not have permission to execute it.

Initiating/Specified User

If you configure your post function for either the initiating user or a selected user, the relevant issue fields must be included in the associated issue screen.

For example, if you create a rule that updates a field in a related issue, the field must be included in the target issue Edit screen. Similarly, if you define a rule that creates a new issue, or copies a field to a new issue, the field must be included in the Create screen.

Copy Fields

Overwrite / append / prepend

For text fields and other fields that can accept multiple values (like checkboxes), you can overwrite, append, or prepend the new value to any existing value. For a text field, you can also choose a separator between the values.

Create version if necessary

Imagine your origin issue has a version that you want to copy to the linked issue. If the destination field is Fix Version/s, Affects Version/s, or some custom field of type version picker, you can define that a new version will be created in the target project if it does not yet exist. If you don't choose this option and that version does not exist, the user receives an error message and the transition completes.

A user needs the Administer Projects permission to be able to create a new version.

Create component if necessary

Imagine your origin issue has a component that you want to copy to the linked issue. If the destination field is Components, you define that a new component is created in the target project, if it does not yet exist. If you don't choose this option and that component does not yet exist, the user receives an error message and the transition completes.

A user needs the Administer Projects permission to create a new component.

Special sources

In addition to fields, you can select from the following special sources to copy to a destination issue. For example, you can copy the value of the previous user to the Assignee field of a new issue.

  • *** empty ***: The destination field will be cleared.

  • *** last comment ***The last comment from the source issue will be copied. In some cases that might be the comment from the transition screen, which the user just entered while performing the current transition.

  • *** transition comment ***: The comment that the user entered on the transition screen will be copied to the destination field.

  • *** current user ***: The user who triggered the post function will be copied to the destination field.

  • *** previous user ***: The field is updated with the previous user assigned to the destination field. This is valid for single-user picker fields.

  • *** current datetime ***: The current date and time will be copied to the destination field.

Special destinations

  • *** new comment *** : A new comment will be created with the copied value. When you choose to overwrite to new comment, a new comment is created, enabling you to add multiple comments in one post function.
    Examples:
    Copy Description to New Comment, overwrite → creates a new comment with the description.
    Copy Summary to New Comment, append with separator ", " → appends the summary to the previously created comment, so the comment will look like <Description>, <Summary>.
    Copy Assignee to New Comment, overwrite → creates a new comment.
    This configuration will result in two comments being created: one with the description and summary, and one with the assignee.

Example

A workflow is configured so the 'Resolve' transition has the 'Copy Value From Other Field' post function. The 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.

Supported field types

JSU supports many different field types; system fields, as well as custom fields.

You should be aware, however, that not all field types or all combinations are supported. We have tried to cover the most important field types but we are continuously adding more and improving how different field types are supported. We recommend you test JSU with fields to see if it is compatible with your system. Our evaluation license provides you with a 30-day free trial. 

  • No labels