How do you combine/merge multiple custom fields into one field?

Ben
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.
March 2, 2016

When we initially switched to Jira, we imported issues from bugzilla.  As part of this (I wasn't involved), it created a custom field per project, each one labelled the same as External issue ID.  So now, when ever we are doing anything with field configurations, we have 10's of these seemingly identical fields in the list.  Is there a way to collapse these fields into one field – I presume that there will never be a conflict in the actual database, as each one is only populated at all in a single project.


 More generally, the question is can we merge the contents of multiple custom fields into one field.

2 answers

0 votes
Jen Hamilton August 3, 2016

My question is similar.  We have custom fields we need to combine into one field

eg. {Field 1+Field 2+Field 3} = Field 4

eg. {Division +Region+Site} = Development


Please note I have minimal scripting knowledge at this time so if I could get an example to customize I would really be grateful.


Thanks

Hassan Hashmi September 7, 2017

Jen, were you able to figure this out? I am also trying to accomplish the same thing.

Peter DeWitt
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 2, 2017

@Jen Hamilton@Hassan Hashmi, Not sure if you guys ever figured this out but check out Misc Custom Fields add-on.  Unfortunately its not supported but it is free and should allow the combination of multiple text fields into another field.

https://marketplace.atlassian.com/plugins/com.innovalog.jmcf.jira-misc-custom-fields/server/overview

Zoltan Orosz December 28, 2017

@Jen Hamilton @Hassan Hashmi @Peter DeWitt

You can bulk change the issues and remove the old ones.
1, Create the new option in your costume field
2, Create query for the matching costume fields
(eg.: project = myProject AND "MyCostumeField" = "Division" )
3, on the query screen under tools you can find bulk change
4, remove the old "Division" option from the custom field.

0 votes
Boris Georgiev _Appfire_
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.
March 2, 2016

I don't think that merging the values can be achieved without modifying the database directly OR using a script (groovy for example) and since I see you added cloud to the tags of the question I don't think you can do this.

I think the only option would be to :

  1. export your cloud instance and import it to a server installation
  2. Modify the data - merging the fields via SQL or Groovy Script
  3. Create a backup of this temporary server instance and import back to cloud

I would recommend doing the field merge via the JIRA API and not the database directly and the way it could work is:

  1. Create new field which have a context for each project or 1 global context and name it for example NEW External Issue ID
  2. Write a plugin or groovy script that copies the value from External issue ID to NEW EXTERNAL ISSUE ID
  3. Delete the all the old fields

 

Boris Georgiev _Appfire_
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.
March 2, 2016

Actually there might be a much simpler solution to that - take a look at the issue export/import to/from Excel - I think you can achieve the same as with script

  1. Create new field
  2. Export all the issues
  3. Rename the old field column to the new field
  4. Remove all other columns
  5. Import the excel, so it updates all your issues and sets the value of the new field to the value of the old field.
  6. Then just remove all old fields.

Aaand this should work for cloud without needing to go through a temporary server installation

Suggest an answer

Log in or Sign up to answer