修复:更新禅道数据脚本

This commit is contained in:
yystopf 2024-03-28 09:40:15 +08:00
parent d3b552337e
commit 7880ec1779
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ namespace :import_from_chandao do
name = args.name
CSV.foreach("#{Rails.root}/#{args.name}", headers: true) do | row |
randd_field_hash = row.to_hash
issue = Issue.new
issue = Issue.new(issue_classify: "issue")
author = User.like(randd_field_hash['由谁创建']).take
issue.author_id = author&.id
assigner = randd_field_hash['指派给'].present? ? User.like(randd_field_hash['指派给']).take : nil
@ -46,7 +46,7 @@ namespace :import_from_chandao do
pm_project_id = args.pm_project_id
CSV.foreach("#{Rails.root}/#{name}", headers: true) do | row |
randd_field_hash = row.to_hash
issue = Issue.new
issue = Issue.new(issue_classify: "issue")
author = User.like(randd_field_hash['由谁创建']).take
issue.author_id = author&.id
assigner = randd_field_hash['指派给'].present? ? User.like(randd_field_hash['指派给']).take : nil
@ -81,7 +81,7 @@ namespace :import_from_chandao do
pm_project_id = args.pm_project_id
CSV.foreach("#{Rails.root}/#{name}", headers: true) do | row |
randd_field_hash = row.to_hash
issue = Issue.new
issue = Issue.new(issue_classify: "issue")
author = User.like(randd_field_hash['由谁创建']).take
issue.author_id = author&.id
assigner = randd_field_hash['指派给'].present? ? User.like(randd_field_hash['指派给']).take : nil