Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,658
Community Members
 
Community Events
184
Community Groups

Delete empty columns in CSV exported files by Excel

Hello there,

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

How-to:

  • Export issues to CSV
    export.png
  • Open exported CSV file in Excel. Please note, that in some cases Excel can't open a CSV correctly. In that case you can try import data from the CSV and copy header names.
  • Press alt+F11
  • In the opened window click 'Insert' -> 'Module' 
    insertModule.png
  • In the window paste the code
  • Press F5
  • The script should remove all empty columns

I hope this will be helpful.

Regards,
Andrey

1 comment

Marjorie
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.
May 02, 2023

Thanks for this information, @Andrew 

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events