TakiJoe / redmine_import_issues

2 stars 3 forks source link

unabale to import core field like category_id and fixed_version_id #4

Closed excceed closed 6 years ago

excceed commented 6 years ago

I found the plugin unabale to import target_version value (fixed_version_id) for the case there are 2 different projects with the same issue versions.

To be a little more description clear my situation: Project A,the target version are TI,VRS,EL. Issue list can be imported correctly with target version value. Project B,with same target version are TI,VRS,EL. Issue list cannot be imported with an error "target version is not included in the list" on the page. Import process has finished with errors.

No error in log.

Started GET "/redmine/projects/bbb/importer_issues/58/import" for 127.0.0.1 at 2017-12-17 00:37:17 +0800 Processing by ImporterIssuesController#import as HTML Parameters: {"project_id"=>"bbb", "id"=>"58"} Current user: d038626 (id=1) Rendered plugins/redmine_import_issues/app/views/importer_issues/_log.html.erb (28.0ms) Rendered plugins/redmine_import_issues/app/views/importer_issues/import.html.erb within layouts/base (31.0ms) Rendered plugins/quick_view/app/views/hooks/_quick_view_base_head.html.erb (0.0ms) Rendered inline template (1.0ms) Rendered plugins/sidebar_hide/app/views/sidebar/_hideButton_partial.html.erb (1.0ms) Rendered plugins/quick_view/app/views/hooks/_quick_view_base_bottom_tooltip.html.erb (1.0ms) Rendered plugins/quick_view/app/views/hooks/_quick_view_base_bottom.html.erb (2.0ms) Rendered plugins/quick_view/app/views/hooks/_quick_view_base_bottom_worktime_ext.html.erb (0.0ms) Completed 200 OK in 7265ms (Views: 59.0ms | ActiveRecord: 990.0ms)

@TakiJoe I would appreciate if yo could have some time to check this issue :)👍

excceed commented 6 years ago

@TakiJoe Could you help me:)

I don't know if the below lines in import_action.rb caused theissue, perhaps a stupid idea to add a condition with project_id must equals current project to be import.

when "fixed_version_id" if format == :string v = Version.find_by_name(value).id rescue -1 else v = Version.find_by_id(value).id rescue -1 end

excceed commented 6 years ago

https://github.com/TakiJoe/redmine_import_issues/compare/master...excceed:patch-1?expand=1

I opened a pull request could fixed this one.