更改:禅道脚本中数据为空处理

This commit is contained in:
yystopf 2024-02-03 14:47:59 +08:00
parent 8bdad1d1c0
commit 7f6c6383bc
1 changed files with 6 additions and 2 deletions

View File

@ -12,7 +12,9 @@ namespace :import_from_chandao do
author = User.like(randd_field_hash['由谁创建']).take
issue.author_id = author&.id
assigner = User.like(randd_field_hash['指派给']).take
issue.assigners << assigner
if assigner.present?
issue.assigners << assigner
end
issue.status_id = IssueStatus.first.id
issue.tracker_id = Tracker.first.id
issue.priority_id = randd_field_hash['优先级'].to_i
@ -37,7 +39,9 @@ namespace :import_from_chandao do
author = User.like(randd_field_hash['由谁创建']).take
issue.author_id = author&.id
assigner = User.like(randd_field_hash['指派给']).take
issue.assigners << assigner
if assigner.present?
issue.assigners << assigner
end
issue.status_id = IssueStatus.first.id
issue.tracker_id = Tracker.first.id
issue.priority_id = randd_field_hash['优先级'].to_i