Convert Select List (single choice) to Select List (multiple choice)

John Consorti December 15, 2014

Hi,

I am trying to figure out how to convert a field we have [Select List (single choice)] into a [Select List (multiple choice)] field.  We have many options and this has been a single choice field for quite some time.  Is there an easy way to convert this and keep all the past data?

1 answer

3 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 15, 2014

No, but sort of yes.

No, because you need to hack the database, and I rarely recommend that.  But in this case, actually, yes, you can actually just change the type - see https://confluence.atlassian.com/display/JIRA/Changing+Custom+Field+Types

 
Just be sure you want to do this - the process is a nightmare to do in the opposite direction (multi to single) and, as always, backups are your absolute best friend ever.  Seriously.  Test it in dev/test, and always have a backup before you amend anything.

Robert G. Nadon
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.
August 22, 2016

Hi @Nic Brough [Adaptavist],

You said the process is a nightmare to do in the opposite direction (multi to single select).  Well my customer just asked me to do that exact thing.  I am trying to talk them out of it, but if I fail any thoughts on how to do that?

My only thought was to create a new Select list that has the same values as the multi select and bulk issue change, and add the value to the new field (There are about 40 values so that means 40 bulk changes).   From there delete the multi and rename the single to the name of the multi. Fortunately I am the only admin and I know there are no validators/scripts/etc that call that field or their field ID would need to be changed as well.  

Any other unseen problems with this method?

Any other ways?

Thanks!

Robert

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 22, 2016

I think you've got everything covered there, but you could go from multi-select to single-select in the database.

The main problem there is now usually just the customer.  It's often hard to get them to explain which single value they want to keep, but if you can get that out of them, then you can use SQL to cast back from an array to a single value.

Robert G. Nadon
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.
August 22, 2016

OK cool. I created scripted custom field to count the values in the multi select field and there are only 0 or 1.  That should help.  I do get nervous about changing the DB, but I could just create a sandbox and do it there first.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 22, 2016

Always try it on test first wink

Dane Kantner September 30, 2017

That page now references that it no longer is compatible; I tried switching from a single to multiselect in the DB and noticed no difference in the UI... I assume that's why?

 

Is there some other process now?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 1, 2017

Did you take Jira offline before making the change?  And Re-indexed in full afterwards?

Dane Kantner October 2, 2017

I had taken it offline but not reindexed, it's resolved and working now... Now working on getting it to look/feel like the "component" boxes, the default multiselect is kinda dated in look and utility (..even Atlassian seems to think so as their own multiselect fields are jazzed up w/ additional javascript).

Amy_Hall September 27, 2019

I need to do this change but I am on Jira Cloud.  Is there any way to do this?  I don't believe I have access to the database.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 28, 2019

You cannot use the database hack on Cloud, as yes, you have no access to the database.

You will have to do this by hand - create a new custom field and use bulk-edit or the REST API to copy data from the old field to the new one, then delete the old field.

Suggest an answer

Log in or Sign up to answer