Forums

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

Set value of a new field for all existing issues based on an existing field

Martin Hirsch
Contributor
September 18, 2023

We have introduced a new field in tasks and bugs and would like to delete the previously used one. To do this, however, the value in the old field must first be set to the new field for all issues. How can I solve this?

2 answers

0 votes
Tomáš Vlach
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.
September 18, 2023

Hi @Martin Hirsch

could you share with us what are those mentioned values? Are those lots of unique values, or few repetetive one and how many issues are we talking?

Just to make sure that bulk change of the issues filtered by one of the values wouldnt be an option.

If there are lot of unique values I would use Scriptrunner as mentioned @S Reddy Harsha Vardhan as an easiest and quickest option.

 

Tom

Martin Hirsch
Contributor
September 18, 2023

We have round about 2000 issues and the value is a url, unique in each issue.

Tomáš Vlach
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.
September 18, 2023

Allright, 

 

in that case - you should be able to create new Automation that could help us with this task.

 

Create new automation - as a trigger choose - Scheduled

(you can keep rune every 1 week on Monday, doesnt matter we will run in manually)

Check - Run a JQL search and execute actions for each issue in the query

Use for example this JQL issuetype = Task OR issuetype = Bug (you can create better filter to get only the issues you need)

 

ac_copyvalues_automation1.png

Then the next step would be adding new component - add FOR EACH: Create a branch - Branch rule / related issue - type of relates issues Current Issue - Save - Under this Add an action and choose Edit Issue 

Choose fields to set - there you need to check the new custom field you created

Then click on the three dots on the right and select COPY - click on the text Copy "NewField" from Current issue and Field to copy value from there you select the old custom field and click save.

ac_copyvalues_automation3.png

Then you should be able to run manually this rule by the button on the top right screen.

ac_copyvalues_automation2.png

Before you do - BE VERY CAUTIOUS please and try this on small batch of issues (you can do that be editing the JQL query) Dont forget to disable this rule after!

Tom

0 votes
S Reddy Harsha Vardhan September 18, 2023

If you have the scriptrunner plugin, you can use the "Copy-Field Values" in the built-in script functionality to achieve this. First, you need to create a filter that pulls the list of all issues that have data in that field, and then in that "Copy-Field Values" section, select the filter followed by source and target fields. Once that is done, click on Run, and you can have all your old field data copied to the new field.

Martin Hirsch
Contributor
September 18, 2023

Sounds good. But we don't have the plugin in the moment. Is there another way?

Amelie Winkler _Appfire_
Atlassian Partner
September 18, 2023

Hi @Martin Hirsch – Amelie from the Appfire team here.

@S Reddy Harsha Vardhan is right – Scriptrunner would be a great solution! As you don't have it in your instance, any chance you already have the Power Scripts plugin? It's an equivalent app that could help you achieve the same thing.

If you don't have either of them, you might want to have a look at them, they are quite useful if you need to automate tasks based on logic

Martin Hirsch
Contributor
September 18, 2023

Not in the moment. But i think it will be a good idea, to have the possibilities to run scripts.

Amelie Winkler _Appfire_
Atlassian Partner
September 18, 2023

Yeah, they're great for some of the more complex requirements. Both apps also offer a 30-day free trial, so you could test them out and see for yourself.

If you end up trying out Power Scripts – let me know if you have any questions, I'm happy to help!

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