Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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
John Funk Community Leader Feb 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. 

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!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Posted in Jira Software

Presenting the "Best of 2020" Jira Software roundup!

Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...

7,120 views 8 28
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you