How to Convert a Multi-Select Custom Field into Labels

Still need help?

The Atlassian Community is here for you.

Ask the community


To migrate a multi-select field into the new labels listing,

  1. Make a copy of the database (a full SQL dump.)
  2. Put the backup into a new database and do the following to the COPY:
    
    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
    
    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.
  3. Export all of the rows as inserts from the resulting select:
     SELECT * FROM label WHERE ID > X ORDER BY ID 
    * Where X is the same X as above.
  4. With the original JIRA database, run the generated insert statements.
  5. 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.)
  6. Restart JIRA
  7. Rebuild JIRA cache
Last modified on Feb 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.