Change Custom Fields Type

Could I change a custom field type ? for example from "Number Field" to "Text Field" ?

Or how could I import the data from the old filed to the new one ?

2 answers

1 accepted

Accepted Answer
0 votes

Yes, it can be done. Steps:

0. Add the new CF

1. Ensure you have exclusive acess to JIRA

2. Install JJupin

3. Add the SIL runner on the dashboard and run the following script

string [] keys = selectIssues("project = PRJ");

for(string k in keys) {

//assign new to old value, possible with conversion. Error treatment is your responsibility

%k%.customfield_1234 = %k%.customfield_54321;

}

4. Run it

5. (optional) If you have many issues, go out and have a cup of coffee, smile at the sun

6. Uninstall JJupin (or buy it)

7. Delete the old field if unused anymore

Note: I did not tested the above, and anyway you're adviced to do backups and test it first; don't do it in production directly.

0 votes

As far as I am aware, it is not possible to "directly" import field values from one field to another, nor is it possible to change the type of an existing custom field.

One option would be to make use of the "Copy Value From Field to Field" post function.
This would mean you will have to create transitions in your existing workflows, pointing from the current status back to itself. In this transition, you use the "Copy Value From Field to Field" to set the values to the new field. Once all fields have been adjusted, the old field can get removed, as well as the transactions.

Depending on the amount of different statuses of issues of which you will need to change the fields of, this might be a lot of work. Alternatively, you could look into trying to copy the value of the fields over in the database, however I would advice against doing this, or at the least perform this in a test environment first before doing this in a production environment. At all times ensure you have backups of your production environment when making changes like this.

The JIRA documentation says otherwise: https://confluence.atlassian.com/display/JIRAKB/Changing+Custom+Field+Types+in+JIRA Unfortunately the documentation isn't accurate as it is.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

414 views 7 5
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you