Copy values between two custom fields with Jira Cloud automation rules
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
If you're trying to copy the content of 1 text field (Field A) into another text field (Field B), you can accomplish this using a Jira automation rule. The same methods can also be used with most other field types, including number fields, and user picker fields.
Solution
Use the Copy From action in automation
Navigate to either your desired project, or the Global automation page in Jira
Create a new automation rule
Add the Edit Issue action to the rule
Select the Field that needs to be set ("Field B" in our example)
Select ...(More options) > Copy from...
Issue to copy value from: "Current Issue"
Field to copy value from: select the source field ("Field A" in our example)
If the field isn't directly available, use Smart Values
Some fields, like the Original Story Points field, aren't directly supported by Automation, and won't appear in the Copy from dialog in the rule editor.
We can still copy data from these fields, but we'll leverage Smart Values to do so. Let's build a rule to copy Original Story Points into the Story Points field:
Navigate to either your desired project, or the Global automation page in Jira
Create a new automation rule
Add the Edit Issue action to the automation rule
Select the Field that needs to be set ("Story Points" for example)
Copy and paste the string below into the field
|
Keep in mind, you can also change the Original Story Points field in the Smart Value to other fields that aren't directly available in the Automation editor.
Use JSON object in Automation rules
If you wish to use a JSON formula to perform the field copy via the Additional fields section, you can follow these steps.
Add the Edit Issue action
Do not select any fields
Instead, expand the More Options setting
Copy the JSON formula below into the Additional fields section
Make sure to change "Target Field" with the name of the target field of your choice, and "Source Field" with the name of the source field of your choice.
|
Note: Inserting JSON objects 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 articles below:
Was this helpful?