How to Convert a Multi-Select Custom Field into Labels
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
To migrate a multi-select field into the new labels
listing,
Make a copy of the database (a full SQL dump.)
Put the backup into a new database and do the following to the COPY:
1 2
ALTER TABLE `label` CHANGE `ID` `ID` int(10) NOT NULL auto_increment; ALTER TABLE label AUTO_INCREMENT = X;
* Where X is the highest ID in the label table
1 2 3 4
INSERT INTO label (FIELDID, ISSUE, LABEL) SELECT DISTINCT NULL AS FIELDID, ISSUE, STRINGVALUE AS LABEL FROM customfieldvalue WHERE CUSTOMFIELD = Y;
* Where Y is the ID of our custom field in the
customfield
table.Export all of the rows as inserts from the resulting select:
1
SELECT * FROM label WHERE ID > X ORDER BY ID
* Where X is the same X as above.
With the original JIRA database, run the generated insert statements.
In the SEQUENCE_VALUE_ITEM table, look for the row with SEQ_NAME = "Label". In that row, you must alter SEQ_ID to whatever is the new highest ID in your label table rounded up to the nearest 10. (e.g. if you label table had a highest ID of 104, you should put 110 into SEQ_ID.)
Restart JIRA
Rebuild JIRA cache
Was this helpful?