As you know, Jira exports issues to CSV (all fields) all associated custom fields, even if they are empty. So, when you import this CSV Jira also asks you to fill in mapping a lot of unnecessary custom fields.
There is a short VBA script for Excel to delete all empty columns.
Sub DeleteEmptyCol()
Dim rng As Range
Dim backupHeader As Variant
Dim inputRng As Range
'Select all cells in the worksheet
Set inputRng = Range("A1").CurrentRegion
Application.ScreenUpdating = False
'Go through columns
For i = inputRng.Columns.Count To 1 Step -1
'Remember the current header name
backupHeader = inputRng.Cells(1, i).Value
'Remove the current header, if necessary we return it back later
inputRng.Cells(1, i).Clear
Set rng = inputRng.Cells(1, i).EntireColumn
If Application.WorksheetFunction.CountA(rng) = 0 Then
'delete column if all cells are empty
'Debug.Print "Delete " + backupHeader
rng.Delete
Else
'return header back if column contains data
'Debug.Print "Return " + backupHeader
inputRng.Cells(1, i).Value = backupHeader
End If
Next
Application.ScreenUpdating = True
End Sub
I hope this will be helpful.
Regards,
Andrey
Andrew
Senior systems engineer
EPAM Sytems
43 accepted answers
1 comment