Merge pull request #2193 from okriuchykhin/ok_SCI_4028

Fix reports in team importer [SCI-4028]
This commit is contained in:
Alex Kriuchykhin 2019-11-13 13:10:15 +01:00 committed by GitHub
commit 8b665d4f1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,6 +24,7 @@ class TeamImporter
@result_mappings = {}
@checklist_mappings = {}
@table_mappings = {}
@report_mappings = {}
@project_counter = 0
@repository_counter = 0
@ -854,12 +855,14 @@ class TeamImporter
report_el_parent_mappings = {}
report_element_mappings = {}
report = Report.new(report_json['report'])
orig_report_id = report.id
report.id = nil
report.project_id = @project_mappings[report.project_id]
report.user_id = find_user(report.user_id)
report.last_modified_by_id = find_user(report.last_modified_by_id)
report.team_id = team.id
report.save!
@report_mappings[orig_report_id] = report.id
@report_counter += 1
report_json['report_elements'].each do |report_element_json|
report_element = ReportElement.new(report_element_json)