Automation for Jira - Different ways to copy the value of a field into another field

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The purpose of this knowledge article is to describe various ways to copy the content of a field into another field in a Jira issue.

Solution

Solution 1

For this solution, we will assume that we are trying to copy the content of 1 text field (Text Field 1) into another text field (Text Field 2), but note that the same methods can be used with most other field types (number type, etc...).

This solution is the simplest one and consists in the following steps:

  • Add the Edit Issue action in the automation rule

  • Select the Field that needs to be set ("Text Field 1" in our example)

  • Go to the menu ... > Copy from... and choose the options below:

    • Issue to copy value from: "Current Issue"

    • Field to copy value from: select the source field ("Text Field 2" in our example)

The screenshot below illustrates this solution:

Copy data from one field to another using Automation

Solution 2

There can be some situation where the source field cannot be selected from the menu ... > Copy from... > Issue to copy value from. It will happen if this field is not officially supported by Automation For Jira, such as the field Original Story Points that is coming from Advanced Roadmap. In such a case, you will need to use a different method to copy the value from one field to another.

In the solution described below, we will assume that we are trying to copy the content of the Original Story Points field into the Story Points field, but note that this method can be used with most other field types:

  • Add the Edit Issue action in the automation rule

  • Select the Field that needs to be set ("Story Points" in our example)

  • Copy and paste the string below into the field (after replacing "Original Story Points" with the name of the field from which you wish to copy the data):

{{triggerIssue.Original story points}}

The screenshot below illustrates this solution:

Copy data from Story points field to original story points

Solution 3

Normally, solutions 1 and 2 should help with copying a field into another field.

If you wish to use a JSON formula to perform the field copy via the Additional fields section, you can use this solution.

To copy the value of a text field into another text field (or from a number field into another number field), you can follow the steps below:

  • Add the Edit Issue action

  • Do not select any field instead, expand the More Options setting

  • Copy the JSON formula below into the Additional fields section Make sure to change "Text Field 1" with the name of the target field of your choice, and "Text Field 2" with the name of the source field of your choice.

{"fields": {"Text Field 1": "{{triggerIssue.Text Field 2}}"}}

The screenshot below illustrates this solution:

Set custom field using smart value

Solution 3 described above will only work with basic field types such as the Text and Number types. If you are looking into using a JSON formula to copy array-type fields such as Multi-User picker or Multi-Option fields, you will need to use a different syntax. The solutions that apply to these types of fields are described in the KB article below:

Updated on June 13, 2024

Still need help?

The Atlassian Community is here for you.