Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I copy data in one label field to another label field?

Robert Reagan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 18, 2021

I migrated tickets from another system into Jira. That other system had 4 different label fields. I want to capture all the labels for each ticket in those different fields and put them all in the `Labels` Field in Jira.

2 answers

1 vote
Mykenna Cepek
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 18, 2021

You can use Jira Automation to do this.

https://support.atlassian.com/jira-software-cloud/docs/automate-your-jira-cloud-processes-and-workflows/

When you use the "Edit issues" action with the "Labels" field, it gives you an option to "add/remove" values. You'd use the "Add" part to copy a value from one of those custom fields into the "Labels" field.

Use that same action several times, once for each custom field.

An outer loop through all the issues of interest in the instance should accomplish the goal with one theoretical click.

If the "Labels" field already has values in it, then I might suggest creating another "Labels-temp" field to help you test this rule. That way you can clear it out while you debug your rule, and then run it one last time against the real "Labels" field when you're confident it's working.

If you're new to Automation, here are a few other tips:

  • Use a conditional before each "Edit issue" action, to ensure that the custom field of interest is not empty - you only want to copy the value if there IS a value to copy.
  • If you have a lot of issues, the outer loop could be based on some JQL that ignores issues that have no values in any of those custom fields. This will speed up the rule.
  • Use the "Scheduled Trigger" for the rule, with a Cron of "59 59 23 31 12 ? 2000". This literally means "only run this rule during the last minute of the year 2000" - in other words, the rule will never run by itself. Use the "Run rule" button when editing the rule to manually execute the rule.

Best wishes!

1 vote
John Funk
Community Champion
February 18, 2021

Hi Robert - Welcome to the Atlassian Community!

You can do that using Automation For Jira. Here is some information on the tool to get you started:

There are two types of automation:

  • Global: In the Free version, you get 100 executions per product, per month
  • Project: In all versions, you get unlimited executions per month

Automation Basics: https://www.atlassian.com/software/jira/guides/expand-jira/automation

You can do this via global rules to apply to all projects also. You'll need to be a Jira Admin/Site Admin, go to Jira Settings > System > Automation Rules (left-hand menu).

For more on using Automation For Jira see these help pages.

Jira Automation Template Library to help get you started quickly:

https://www.atlassian.com/software/jira/automation-template-library#/labels/all/customLabelId/1453

For your process, you would start with a Schedule Trigger for 1 day.

Then use JQL to identify the issues you want to modify.

Then do a new Action for Edit Issue.

Choose the Labels field

Click the 3 dots menu and select Copy From

Select Current Issue

Click on the words Current Issue again and select From this Issue and then select the field. 

Then save and publish the rule.

Then click on the Run rule button.

You will probably need to do that 4 different times, changing the Copy from field value for each of the 4 fields you imported. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events