CSV import causes IndexOutOfBoundsException
Symptoms
When importing issues from CSV the, operation fails with the exception:
Cause:
java.lang.IndexOutOfBoundsException: Index: 5, Size: 5
Stack Trace: [hide]
java.lang.IndexOutOfBoundsException: Index: 5, Size: 5
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at webwork.util.ValueStack.findValue(ValueStack.java:467)
Cause
The CSV file format is invalid possibly because:
- The CSV file does not contain a heading row.
- Each row must contain a column for summary data
Resolution
- The CSV importer assumes a Microsoft Excel styled CSV file. Fields are separated by commas, and enclosed in quotes if they contain commas or quotes. Embedded quotes are doubled. Make sure the CSV file is well formed by opening it in Excel, or by confirming the format otherwise.
- The CSV file must contain a heading row. The CSV configuration wizard uses the CSV header row extensively. The header values should not have any punctuation (beyond the commas separating records) such as apostrophes or the importer may not work correctly.
- As a minimum, the CSV file must contain a column for Summary data.
It is possible to have multi-lined CSV. For example, here is a valid file with a single record:
Summary,Description,Status
Login fails,"This is on
a new line",Open
Last modified on Mar 21, 2024
Powered by Confluence and Scroll Viewport.