Hi
we're running into the Data Center edition.
There is a Single select dropdown Customer field across all the projects of the firm.
I received a request from my Management to convert it as a multiselect field.
My opinion
I'd be happy, if you suggest a way to achieve this I'd really appreciate it.
Regards,
Prabhu
Actually, this is one of the few times it is ok to use SQL on a Jira database. It is a slog, you still need to be very careful, and it is usually NOT recommended to go the other way, but when some fields are of a certain type, it is possible to "convert" them to another compatible type with a bit of hackery.
The rules are:
To do it
cool! you should do a video KB on this. ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'll try this and thanks for your suggestions!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can’t convert a field from single select to multi select. At least this is my understanding and my experience in cloud. What you could consider doing is create a new multi select with all of the same options. Then you could use CSV to import the values from existing issues. Disclaimer – I have not done this myself but I understand from others that it will work and my understanding of import would seem to back that up. Certainly worth a try a test project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That doesn't seem to work in Jira (Server/DC). Just tested here.
It happens that when you export the CSV, you're actually populating the table with the current value presented in the field at that moment you're exporting the issue to the CSV. So, when you're importing back to the system, the only value brought, is the one chosen for that field, not all the values available for picking.
So in the end, it's not possible to convert in Server/DC solution.
Not sure about Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still, it seems that Behaviours from ScriptRunner allow you to do it. You might want to look at it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, there's a couple of things here.
If you use CSV to import issue values into a select list (of any type - single, multi, radio, checkbox etc), then it can create the options you need to add to it as you go.
I've used this a few times in the past to populate large numbers of options into fields by creating dummy projects, importing one issue per option I want to add, and then killing the project off later.
And, I'm afraid Behaviours won't help you here. Behaviours works on the front-end, and although you could get it to convert the use of a single-select so it looks like a multi-select, it will fail when saving values because the single-select option won't be there for multiple values.
You could use Scriptrunner console to copy the options over into the new field though, and copy the issue values into the field as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another detail regarding the import from a CSV is that the only way Jira allows a user to import a CSV mapping a Single-select CF to a Multi-select CF type, is via the External System Import, in the Jira Admin > System. So that's not a task that an ordinary user would be able to do.
So, in the end, the best approach for this scenario would be the change in the database.
But one thing it didn't get clear for me @Nic Brough -Adaptavist-, and I'm sorry for my ignorance here, is how did you manage to perform the export of the values available on the options of the field. As a matter of learning and morbid curiosity,, would you mind sharing the steps?
Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, the population of the options list is definitely an admin thing, done with external import (it would be an admin action anyway, you need to be an admin to edit the options in select lists)
I would run away screaming from "do it in the database". Unless you know exactly what you are doing, you are going to break your Jira. You also need proven backups, significant downtime, a proper-roll back plan and decent testing before you even think of this.
Getting the list of options to go into a field isn't hard, but is a bit of fiddling with data. Sometimes, the list is given to us, but that's for new fields, not converting existing ones. With a conversion, I've seen people simply scrape it from the html of the create issue screen, scrape it from the admin screen for the list of option in the custom field options, or use a REST call to fetch it. In all of those, you have to do a bit of work to convert html, tables or json into a simple CSV list, but it's not that hard.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.