HowTo import issues » History » Version 6

Mischa The Evil, 2017-07-02 10:46
Add some info and examples from #25799.

1 1 Moritz Who Cares
h1. HowTo import issues
2 1 Moritz Who Cares
3 6 Mischa The Evil
"Since 3.2.0":http://www.redmine.org/news/104 Redmine can import issues from CSV files (#950).
4 6 Mischa The Evil
In the issues tab there is a import link on the right. You can import any CSV-type file. The first line must contain the column names. You can freely assign them to the different fields of an issue.
5 1 Moritz Who Cares
6 1 Moritz Who Cares
h2. Notes on different Fields
7 1 Moritz Who Cares
8 1 Moritz Who Cares
h3. Parent Issue
9 3 Moritz Who Cares
10 1 Moritz Who Cares
If the field starts with an #, the issue with that id is referenced. If the field contains a number it references the index of the issue in the import. Note that it's not the line number as line 1 contains the header.
11 1 Moritz Who Cares
12 6 Mischa The Evil
From #23396#note-2:
13 6 Mischa The Evil
> Jean-Philippe Lang wrote:
14 6 Mischa The Evil
>> When importing issues, the content of a the parent colum can be:
15 6 Mischa The Evil
>> * a number without # (eg: 10) => the parent will be the 10th imported issue
16 6 Mischa The Evil
>> * a number with # (eg: !#10) => the parent will be the existing issue with id=10
17 6 Mischa The Evil
18 6 Mischa The Evil
{{collapse(Two examples...)
19 6 Mischa The Evil
A CSV file looking like follows (note the parent column values with the #-sign omitted):
20 6 Mischa The Evil
21 6 Mischa The Evil
|Subject|Startdate|Duedate   |Parent|
22 6 Mischa The Evil
|taskA  |1/1/2016 |12/31/2016|      |
23 6 Mischa The Evil
|taskB  |1/1/2016 |12/31/2016|@1@   |
24 6 Mischa The Evil
|taskC  |1/1/2016 |12/31/2016|@1@   |
25 6 Mischa The Evil
|taskD  |1/1/2016 |12/31/2016|@3@   |
26 6 Mischa The Evil
|taskE  |1/1/2016 |12/31/2016|@3@   |
27 6 Mischa The Evil
|taskF  |1/4/2016 |12/31/2016|@4@   |
28 6 Mischa The Evil
29 6 Mischa The Evil
will be imported creating the following issues tree:
30 6 Mischa The Evil
<pre>
31 6 Mischa The Evil
taskA
32 6 Mischa The Evil
 -> taskB
33 6 Mischa The Evil
 -> taskC
34 6 Mischa The Evil
     -> taskD
35 6 Mischa The Evil
         -> taskF
36 6 Mischa The Evil
     -> taskE
37 6 Mischa The Evil
</pre>
38 6 Mischa The Evil
39 6 Mischa The Evil
And, starting with Redmine version#119, you can even use a CSV file like:
40 6 Mischa The Evil
41 6 Mischa The Evil
|Subject|Startdate|Duedate   |Parent|
42 6 Mischa The Evil
|taskF  |1/4/2016 |12/31/2016|@2@   |
43 6 Mischa The Evil
|taskD  |1/1/2016 |12/31/2016|@5@   |
44 6 Mischa The Evil
|taskE  |1/1/2016 |12/31/2016|@5@   |
45 6 Mischa The Evil
|taskB  |1/1/2016 |12/31/2016|@6@   |
46 6 Mischa The Evil
|taskC  |1/1/2016 |12/31/2016|@6@   |
47 6 Mischa The Evil
|taskA  |1/1/2016 |12/31/2016|      |
48 6 Mischa The Evil
49 6 Mischa The Evil
which will be imported creating the following issues tree (equal to the example above):
50 6 Mischa The Evil
<pre>
51 6 Mischa The Evil
taskA
52 6 Mischa The Evil
 -> taskB
53 6 Mischa The Evil
 -> taskC
54 6 Mischa The Evil
     -> taskD
55 6 Mischa The Evil
         -> taskF
56 6 Mischa The Evil
     -> taskE
57 6 Mischa The Evil
</pre>
58 6 Mischa The Evil
This extended feature behaviour is implemented through a separated issue (#22701).
59 6 Mischa The Evil
}}
60 6 Mischa The Evil
61 3 Moritz Who Cares
h3. Assignee
62 5 Pablo Estiga
63 5 Pablo Estiga
This must be the username. (Name and lastname works, tested on redmine 3.3)
64 5 Pablo Estiga
65 5 Pablo Estiga
h3. Category and Target version
66 5 Pablo Estiga
67 5 Pablo Estiga
During test with 3.3, the assistant allowed me to use an option to automatically create version or category. 
68 5 Pablo Estiga
69 5 Pablo Estiga
h3. Project
70 5 Pablo Estiga
71 5 Pablo Estiga
The assistant will let you choose on which project you want to import the issue. 
72 5 Pablo Estiga
73 5 Pablo Estiga
h2. Assistant
74 5 Pablo Estiga
75 5 Pablo Estiga
The assistant will help you (tested on 3.3):
76 5 Pablo Estiga
77 5 Pablo Estiga
# Will ask for options with the file:
78 5 Pablo Estiga
*Field separator*
79 5 Pablo Estiga
*Field wrapper*
80 5 Pablo Estiga
*Enconding*
81 5 Pablo Estiga
*Date Format*
82 5 Pablo Estiga
!example_import_options1.jpg!
83 5 Pablo Estiga
# Then next step will ask for the fields to match
84 1 Moritz Who Cares
This is very interesting, because no matter what the names of the columns are, here you map which column is which field on the issue. 
85 5 Pablo Estiga
!example_import_csv.jpg!
86 5 Pablo Estiga
87 6 Mischa The Evil
Attached attachment:"issues.csv" has the CSV used during test with 3.3.