Importing repeatedly creates custom fields with same name

Bryan Tackaberry June 10, 2021

I'm doing migrating tests. Each iteration I build a json file from an old external system,  import using the System's External System Import option, examine the project and then delete it.

During each import new custom fields are created but these are not deleted when the project is. This means I now have 50+ copies of each  custom field - that is, with the same name! (Making options like the Issue Layout window unworkable.)  

How, during import, can I not create a new custom field but rather use an existing one? I've tried including the ID of an existing field but this seems not to work.

How can I delete ALL custom fields when I delete the project?  (How can I delete the many unwanted custom fields I now have?).

I have found references to this issue going back many years but no definite solution and with hints of work to come.   Is this now possible?

Many thanks

Bryan

1 answer

1 accepted

1 vote
Answer accepted
Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 10, 2021

Hi @Bryan Tackaberry 

In your csv, the column header should be Custom field (field_name). When you go through the import settings within Jira, you will then need to make sure that this column is correctly mapped to the Jira field - this should be done automatically if you use the above format, but it is best to double check this. By mapping a column to a field, it will ensure that no new fields are being created.

Unfortunately it is not possible to bulk delete custom fields, as seen in this feature request. Feel free to vote for and watch this, however it was created some years ago so I wouldn't expect it to be available any time soon.

Also looking at this feature request, it isn't yet possible to delete custom fields using the API, so unfortunately this will need to be done manually

Bryan Tackaberry June 10, 2021

Thank you for your quick response.

Does mean it would be better to abandon using json in favour of csv? Seems a retro step but if it works, happy to.  (Also I am assume, but will check, that I only need to go through the import settings once and these can then save.  Allowing me to build up the settings for each iteration.)

Also, I had a thought that I need check -  each time I import I'm adding values to the ['customFieldValues'] array.  But perhaps having done that once, I should just be using the field name to set the value as 'it's already know'?  Will have a play and get back.

Will need to get clicking to delete all those fields I guess!

Again, many thanks.

Bryan

Bryan Tackaberry June 11, 2021

I can confirm that you can save/reload/edit the cvs configuration mapping.

I can confirm that you cannot just use the name of a know custom field in the json to set it's value.

But most of all, I can confirm that deleting hundreds of custom fields one at a time takes a very long time!

So the future is .. csv!

Bryan

Suggest an answer

Log in or Sign up to answer