Support external ID when importing issues (#28213).

Patch by Gregor Schmidt and Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@18285 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2019-06-20 08:17:19 +00:00
parent d915e71d0f
commit 638dbbea95
8 changed files with 66 additions and 12 deletions

View File

@@ -146,6 +146,16 @@ class IssueImportTest < ActiveSupport::TestCase
assert_equal child2, grandchild.parent
end
def test_backward_and_forward_reference_with_unique_id
import = generate_import_with_mapping('import_subtasks_with_unique_id.csv')
import.settings['mapping'] = {'project_id' => '1', 'unique_id' => '0', 'tracker' => '1', 'subject' => '2', 'parent_issue_id' => '3'}
import.save!
root, child1, grandchild, child2 = new_records(Issue, 4) { import.run }
assert_equal root, child1.parent
assert_equal child2, grandchild.parent
end
def test_assignee_should_be_set
import = generate_import_with_mapping
import.mapping.merge!('assigned_to' => '11')