Redmine Importer Documentation¶
In general, the Redmine Importer will take the columns of a .csv file and map them to the fields of issues, and create one issue for each line of the the .csv file. It’s a good way to create Redmine issues when you have a large volume of issues to manage.
Below is a description of how to use the Importer. Also, see the SampleFiles page for a list of sample CSV files you can upload.
Basic Usage¶
Select the “Import” item on the project bar and you will see the first CSV file upload screen. At this screen, you should click the “Choose File” button to select the CSV file to be uploaded. (For existing projects, in the project Settings, inside Modules, you will have to enable “Importer” for the Import item to appear.)
In the example below, the user has already selected “CustomField.csv” and is about to click the “Upload File” button.
Once you click “Upload File”, the Column Matching screen will be displayed. At this second screen, the most important thing is to confirm the mapping from your column headers to the available fields of a Redmine issue. If you are importing relationships between issues, you will also want to see the section on “Unique-valued Column” below to verify your other settings. When the options are correct, hit the “Submit” button.
Your issues will be imported and a summary of the number of records inserted and any problems found will be displayed. Note that importing a large number of issues can take a long time. If you left the “Send notification emails” checked, emails will be sent according to normal Redmine settings; if you turned that checkbox off, no emails will be sent (this can be handy when doing something like porting issues from one installation to another).
CSV Format Notes¶
You should always provide a header row in your CSV file. The titles in this header row will help Redmine Importer figure out which column in your CSV files corresponds to which field of the Redmine issue.
It is suggested to always use UTF-8 encoding, comma as separator, and double-quote as delimiter for your CSV file. However, if you are working with CSV files from a legacy source, you can tweak the CSV file format details via the options in the CSV Upload screen.
The maximum supported size of CSV file depends on your database backend; it’s 4 megabytes for MySQL.
Standard Fields¶
Here is the list of headers the Redmine will automatically recognize; they correspond to fields of a Redmine issue.
Note that while they are all listed here for completeness, all fields are optional. You only need to provide data for the items you actually want to set.
- Subject: The main subject line for the issue. Remember not to use multiple lines here.
- Description: The main description. This value can be multiple lines.
- Assigned To: The username of the person the ticket should be assigned to. This must exactly match the login as found in the Redmine user account.
- Fixed version: The target version field. Existing target versions can be entered here. If the “Auto-add target versions” checkbox is on, any new target versions will be automatically added to the project; if the checkbox is off, unknown target versions will be silently skipped.
- Author: The author of the ticket. It’s rarely necessary to supply this, because it will default to the user who does the upload.
- Category: The ticket category. Existing categories can be entered here. If the “Auto-add categories” checkbox is on, any new categories will be automatically added to the project; if the checkbox is off, unknown categories will be silently skipped.
- Priority: Ticket priority field.
- Tracker: Which Tracker within this project the ticket should be entered in. Normally it’s not needed to provide this, since the default Tracker can be set on the upload page.
- Status: The issue status. Redmine Importer will not create new issue statues, you need to configure those ahead of time in the Settings tab.
- Start date: The start date for the issue, expressed as a string. A number of different date formats will work, but the format (common in America) of a two-digit year (e.g., 03/06/03) is not supported. Be sure to use a format with a four-digit year. Most testing has been done with ISO-8601, which is YYYY-MM-DD.
- Due date: The due date for the issue. Same note as above about date formats applies.
- Done Ratio: Percentage done for the issue, as an integer between 0-100.
- Estimated hours: Estimated time expressed in man-hours.
- Watchers: This column is a comma-separated list of the login names of watchers to add to the new ticket.
- Task Relations: You can provide a column header using any of the values below to set relationships to other tasks. If you import relationships, you must set a unique-valued column. Also see the "Issue Relationships Restriction" section below.
- blocked by
- blocks
- duplicated by
- duplicates
- follows
- precedes
- related to
- Parent Issue: This allows you to set the parent task of the task being imported. If you provide values for this column, you must set a unique-valued column; see below.
- Id: The Redmine issue number. This would only be used when doing issue updates, see Advanced Usage below.
If you use the column headers given above, they should automatically match no matter what language Redmine is displaying.
In addition to the strings above, Redmine Importer will try to automatically match columns which are the same as the localized version of the field names in Redmine. If the columns don’t match automatically, just be sure to set the field match pulldowns in the Column Matching screen.
Custom Fields¶
You should be able to use the importer to import custom fields in the same manner as built-in fields. You need to set the custom fields up in the Settings tab ahead of time; Redmine Importer will not create custom field definitions automatically.
If there is any chance of using your custom field as a unique-valued column (see below) the “Used as a filter” checkbox must be on.
Custom Field Type Notes¶
- The “list” format is not currently supported
- For the “date” format, the acceptable string values depend on the Rails to_date method. I can’t find any documentation of exactly which formats this method accepts, but in particular, it seems to fail on any format with a 2-digit year. Be sure to set your spreadsheet or other program to output four-digit years. YYYY/MM/DD and YYYY-MM-DD formats have been tested to work.
- For “user” fields (Redmine 1.2), the value in the CSV file should be the user’s login name.
- For “version” fields (Redmine 1.2), the value in the CSV file should be name of the target version.
Advanced Usage: Unique-valued Columns and Referring to Other Issues¶
In addition to the basic import functions described above, Redmine Importer supports updating existing issues, setting the parent task of an imported task, and importing task relationships. Doing so requires that one line in your imported CSV file somehow be able to refer to a pre-existing issue or another line in the CSV file.
In these situations, you must specify one column in your CSV file which is a Unique-valued Column, meaning that all the relevant tickets use a different value in this column. This enables you to use the value of that column as a unique identifier when referring to a different issue.
For instance, if you know that all the issues you are working with definitely have different Subject fields, you can use Subject as your Unique-value Column. That means that in your CSV file, when you want to refer to another row, you can refer to it by its subject.
Therefore, you could import parent-child task relationships by having a CSV file like this:
Subject |
Description |
Parent task |
Main Task |
...description... |
|
Sub task |
...description... |
Main Task |
However, it may be difficult to guarantee that issues will always have unique subjects, especially if your users are editing them. Therefore, another way to set up a unique column is to add a custom field in Redmine, and then use the value of the custom field as your Unique Column. If you are using Redmine Importer to transfer information from another system this may be particularly effective; the other system may already have some unique piece of information. Alternatively, if you’re exporting your CSV file from a spreadsheet, it’s quite easy to generate a time+serial number value which is unique for every line.
For instance, if you created a custom field called “External Id” and then wanted to use that as your unique column to import parent/child and dependency relationships, you might end up uploading a CSV file like this:
Subject |
Description |
External Id |
Parent task |
follows |
Main Task |
...description... |
T0001 |
|
|
Sub task 1 |
..description... |
T0002 |
T0001 |
|
Sub task 1A |
..description... |
T0003 |
T0001 |
|
Sub task 1B |
..description... |
T0004 |
T0001 |
T0003 |
Sub task 2A |
..description... |
T0005 |
T0001 |
|
Sub task 2B |
..description... |
T0006 |
T0001 |
T0005 |
When creating new issues, it is only required that your unique column be unique among all the issues you are importing. If you want to update existing issues (see below), the unique column must be unique across all issues in the project.
Updating Existing Issues¶
All of the examples so far have talked about using Redmine Importer to create new issues. However, if your Unique Column values are unique across all issues in your project, you can also use Redmine Importer to update existing issues. To enable this, turn on the “Update Existing Issues” checkbox in the Column Matching screen.
In this case, Redmine Importer will use the value in the unique column to query the database and find the existing issue to update. Remember that all of the matching columns from the CSV file will be updated, so you might overwrite values that have changed in Redmine. If you want to skip a column on import, just set it to “Ignore” on the Column Matching screen.
Referring to Other Issues and Ordering in the CSV File¶
Redmine Importer processes your CSV file in order from the beginning to the end. Because of this, when making references to other columns using unique columns, you can only refer to issues that are earlier in the CSV file. You cannot refer to issues that come further down in the file.
If this is unworkable, there’s a straightforward but non-obvious workaround: import the CSV file twice. The first time, set all of the relationship columns to “Ignore” so you’re just importing the basic data. The second time, be sure to set your Unique Column and to turn on the “Update Existing Issues” checkbox. Since all the issues will already exist in the database, they can now be found.
Issue Relationships Restriction¶
Redmine Importer can only have one column mapped to given field value. Because of this, it cannot import more than one issue relationship of the same relationship type in one upload. That is, while in fact Issue C may “follow” both Issue B and Issue A, because you can’t have two columns with the header “follow” you can’t import that information all at once.
The workaround is to import twice, ignoring one of the columns the first time, and turning on “Update Existing Issues” and ignoring the other column the second time.
Updating Existing Issues and Issue Relationships¶
In general, it’s fine to re-import a CSV file that declares issue relationships. Redmine Importer will check whether the relationship already exists and only create any that are missing. However, Redmine Importer cannot delete relationships, so any issue relationships that were created previously will remain in existence even if they are not in the new CSV file.
Updating Existing Issues and Watchers¶
In the same way, if you re-import a file that includes a Watchers column, any new watchers will be added to the issue, but Redmine Importer never deletes existing watchers.
A note about Redmine Issue numbers¶
If you’ve been around databases, you might think that using the Redmine issue number is the obvious solution for Unique Columns. This works fine for updating: if you create a column whose header is “Id”, it will automatically be recognized as the Redmine issue number and used to refer to other tickets. However, this is often inconvenient because the Redmine issue number doesn’t exist until the issue is created – that means it’s impossible to use it to set up in an import. It can also be impractical to get the Redmine issue numbers out of Redmine after the initial creation.
Import Samples¶
In the redmine_importer/test/samples directory, there are some sample .csv files. See SampleFiles for instructions on how to set up and import all of these files, which will give you a good sense of what Redmine Importer can do.
评论
添加评论
由 swl beyond 在 5 个月 之前添加
刚买过,迅雷没下载成功。怎么刷新下就不让下载了?购物车里面也找不到这个插件?5积分一次下载机会吗?
由 redmineplugins.cn Admin 在 5 个月 之前添加
swl beyond 已发送的邮箱,方便时查收。
由 redmineplugins.cn Admin 在 5 个月 之前添加
swl beyond 你好,网站不支持下载工具。稍候补发到邮箱里。
由 swl beyond 在 5 个月 之前添加
@redmineplugins.cn Admin 好的,谢谢了。刚下载的时候没注意看要禁止下载工具下载。以为就算下载失败也能在购物车里看到重新下载,后来才发现购物车里找不到记录
由 guo hongxing 在 5 个月 之前添加
swl beyond 通过积分下载的插件不会在购物车里显示。只有将插件的付费版本加入购物车后,购物车里才能看到。
由 匿名用户 在 11 个月 之前添加
为什么5.0版本消失了?
由 Tan Frank 在 大约一年 之前添加
这个按照指导(几乎所有的安装指导)都要求运行XXX,但是我确实不知道运行啥,在哪里运行?
比如如下说明:
迁移数据库
windows
set RAILS_ENV=production
bundle exec rake redmine:plugins:migrate
到底该如何 set XXX, 如何 bundle XXXX?
请大神指教。
由 guo hongxing 在 大约一年 之前添加
@Tan Frank 上述指令需要先进入console控制台,再切换到redmine的安装目录下执行。
由 lin alex 在 超过一年 之前添加
想詢問您遇到這個錯誤有沒有解法,我的是4.2.2版本的,謝謝~
StandardError: An error has occurred, all later migrations canceled:
Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
Caused by:
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
由 guo hongxing 在 超过一年 之前添加
@lin alex 你好,试试修改 class CreateImportInProgresses < ActiveRecord::Migration[4.2] ,将4.2改为5.2
由 lin alex 在 超过一年 之前添加
錯誤訊息如下,我有用gem install fastcsv,但似乎還是少了下面的檔案
require’: No such file to load – fastercsv.rb
由 lin alex 在 超过一年 之前添加
感謝您的回覆,似乎有成功安裝插件,但是在顯示錯誤訊息後Server的服務處於開不起來的狀態,如Thin_redmine和Thin_redmine2
,可以詢問您如何解嗎,感謝~
由 guo hongxing 在 超过一年 之前添加
@lin alex 像是插件安装异常导致服务无法正常启动。建议通过手动启动thin,抓到具体的报错原因。方法:bundle exec thin start
由 redmineplugins.cn Admin 在 超过一年 之前添加
@lin alex 不用手动 gem install fastcsv, 重新执行 bundle install 试试看呢?
由 lin alex 在 超过一年 之前添加
Bundle install之前試過,還是會跳一樣的錯誤
由 匿名用户 在 超过一年 之前添加
@lin alex 像是你的redmine_importer的版本问题,插件版本是?
由 lin alex 在 超过一年 之前添加
我是基於這個網址下載的插件
https://github.com/leovitch/redmine_importer
由 guo hongxing 在 超过一年 之前添加
@lin alex 这个版本不支持redmine 4.2.2
由 lin alex 在 超过一年 之前添加
有一個問題想請教,如果有些功能我不想要,可以怎麼快速的讓選項不顯示,感謝~
由 guo hongxing 在 超过一年 之前添加
@lin alex 是什么样的功能? 最好能具体描述下
由 lin alex 在 超过一年 之前添加
可以請您寄給我4.2.2適用的版本嗎,感謝您~
由 redmineplugins.cn Admin 在 超过一年 之前添加
@lin alex 邮件已发
由 匿名用户 在 超过一年 之前添加
很感謝您的幫助,另外有一個問題想請教,如果有些功能我不想要,可以怎麼快速的讓選項不顯示,感謝?
由 匿名用户 在 超过一年 之前添加
錯誤訊息如下,我有用gem install fastcsv,但似乎還是少了下面的檔案,想請您指點如何安裝,感謝?
require’: No such file to load – fastercsv.rb
由 zhu rungang 在 将近 2 年 之前添加
docker 版本 Redmine 5.0.4 支持么,目前服务起不来
由 guo hongxing 在 将近 2 年 之前添加
可以支持 redmine 5.0.4 ,下面是我的测试环境:
由 redmineplugins.cn Admin 在 超过 3 年 之前添加
@rowan wiki 可以在4.2上试试支持4.1的版本
由 rowan wiki 在 超过 3 年 之前添加
是否支持4.2版本?
由 redmineplugins.cn Admin 在 超过 3 年 之前添加
确保你导入的csv文件编码格式为UTF8格式
由 H CJ 在 超过 3 年 之前添加
中文乱码啊