Skip to content
leovitch edited this page Jan 7, 2012 · 11 revisions

Sample Files

In the test/samples directory, there are a number of example CSV files you can use to test out Redmine Importer. This page describes how to go through importing all of these files.

Setup

The samples show various features of Redmine Importer that require some preparation. To get ready, do the following (you will need to a be Redmine Administrator).

  1. Create a new project for testing these issues (e.g., "ImportTest").
  2. Make sure this project has the Tracker named "Bug" enabled on the Projects> ImportTest > Settings > Information tab.
  3. Remember to enable the Redmine Importer plugin for the test project on the Projects > ImportTest > Settings > Modules tab.
  4. Go to Administration > Custom Fields > Issues and click "New Custom Field".
  5. Add a field called "External Id"
  6. Enable this field for the "Bug" tracker
  7. Set the format to Text
  8. Check "Used as filter" (IMPORTANT!)
  9. Hit OK.
  10. Enable this field for the ImportTest project on the Projects > ImportTest > Settings > Information tab.
  11. If you want to be able to test importing watchers, add two users with logins ids of "test1" and "test2" and then add them to the test project in any role.

After that, you can import all the samples in the order given below (some are dependent on previous imports).

AllStandardFields.csv

This example shows how to import all the standard fields that don't involve issue relationships, including Category and Target Version. At the Matching Columns screen, make sure all of your columns default correctly to the standard Redmine fields like below (they should default correctly without you taking any action).

CustomField.csv

This is a simple example of importing a value to the "External Id" custom field.
You don't need to change any of the default settings.

CustomFieldUpdate.csv

This is an example of how to update previously imported values (in this case, one of the issues from CustomField.csv). At the Column Matching screen, be sure to set the Unique Column to "External Id" and to turn on "Update Existing Issues":

ParentTaskBySubject.csv

This shows how to use Subject as the Unique Column to import parent/child relationships. At the Column Match screen, you'll need to set the Unique Column to "Subject" for this to import:

ParentTaskByCustomField.csv

This shows how to combine parent/child relationships and custom fields. At the Column Match screen, you'll need to set the Unique Column to "External Id":

IssueRelationsCustomField.csv

Finally, this is the most full-blown example of setting parent/child relationships, precedes/follows relationships, and custom fields. Set the Unique Column to "External Id":

You'll find you can re-import this many times by checking "Update Existing Issues" when you re-import it.

TypedCustomFields.csv

This file is optional but provides examples of how to import custom fields of type other than 'string'. In order to test this file, you will need to add a series of Custom Issue Fields to your test project. In particular, add:

  • an integer field called "IntegerField"
  • a float field call "FloatField"
  • a boolean field called "BooleanField"
  • a date field called "DateField"
  • a user field called "UserField" (Redmine 1.2 only)
  • a version field called "VersionField" (Redmine 1.2 only)

Finally, go to the project's Settings > Info tab and enable all the custom fields for your test project. When you're done, your "Custom Fields" admin page should look like the following on Redmine 1.1 (on Redmine 1.2 or later, the "UsedField" and "VersionField" should also be present):

Now import this file and make sure all of the fields auto-match. If you're on Redmine 1.1., the UserField and VersionField will default to "ignore":

AllStandardFields.de.csv

This sample is purely optional.

The contents of this file are the same as AllStandardFields.csv, but the column headings are in German. It demonstrates how the column auto-matching can optionally match localized column names. If you want to upload this sample file, you'll need to set your Redmine interface language to Deutsch (German). If your language is set, then at the Column Matching screen all the columns of this sample file should automatically be matched to their fields:

ErroneousStandardFields.csv

This file is optional; it demonstrates the expected error-reporting for various invalid fields.

TypedErroneousCustomFields.csv

This file is optional; it tests the error-handling behavior for typed custom fields. To import this file, you must have defined the typed custom fields as described above under TypedCustomFields.csv. To see the errors, import this file and be sure to turn off "Auto-create target versions."

After importing, an error screen like the below should be displayed.