Change Custom Fields Type

miles lu February 24, 2014

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

0 votes
Answer accepted
Radu Dumitriu
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 24, 2014

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
MJ
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 24, 2014

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.

robk July 30, 2015

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