Change custom field type from text field to numbric field

Dears,

Does anyone have some ideas how to change custom field ype?

I went through https://confluence.atlassian.com/display/JIRA052/Changing+Custom+Field+Types

Unfortunately, we just fall into "Please note that this workaround is only applicable when you have many issues containing the same custom field value. As a scenario let's say you have 100 issues, and each issue have different value for the custom field, it will be very difficult for you to perform the migration by using the steps below."
We have almost 1000 issues in JIRA now. Those issues have different values for the custom field: Weight. We want to change it from Text Field to Number Field and keep value no missing/overriden. Any solution for this kind of situation?

Upgrading custom fields is for Single Version, Multi Version, Single Select, Multi Select, Multi User. I didn't see any more details address my situation.

Does anyone help? Thank you very much.

4 answers

1 accepted

Thank you for your quick reply, rambanam prasad and Nic Brough

@Nic Brough, could you explain with more details to use bulk edit method: copy old text field value to new number field? I do need to keep those values(they are number like 996, 98 but in text field for the moment). When use bulk edit I just see the option to input new value, this will overwrite my different values with the same value. Thank you very much for your help.

Sorry, I wasn't clear there. Bulk edit can only set one value at a time, but on a range of issues. So you'd have to analyse your number values and potentially make hundreds or thousands of edits.

That's also why I mentioned the script runner. If my analysis says I've only got a tiny handful of values (like they're all going to end up as 1, 2, 4, 8 or 16 in the new field), I'd bulk edit. If it turns out I've got 1000 different numbers on 1000 different issues, then I'd be reaching for scripting of some sort.

i am not sure how to do it exactly, but the following post may help you check this

https://answers.atlassian.com/questions/102209/how-do-i-change-the-type-of-a-custom-field

0 votes

The document you have found also has the problem that you can't change between field types that store their data differently. Text fields store text, and number fields store numbers, so you really do not have an easy migration here. "Changing type" is basically inappropriate and you have a migration to do.

What I would do:

  • Rename the current numeric field
  • Add a new text field
  • Use either bulk edit, or SQL to copy the numeric data into the new field from the old one (script runner might do it too if you have that)
  • Delete the old field when you're happy with the new one

Note that if you stick with "change field type", the process is

  • SQL to change the field type
  • SQL to take all the values from the number storage and move it to string storage in the customfieldvalue table (or, in other words, a "bulk edit")

I see. much appreciated. I would consider which method I should apply. Thank you very much.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,888 views 12 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot