This commit is contained in:
yystopf 2024-08-29 16:00:44 +08:00
parent b153a486f3
commit 12ae3b94d9
1 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ namespace :import_from_chandao do
if assigner.present?
issue.assigners << assigner
end
issue.project_issues_index = randd_field_hash['编号'].to_i
issue.project_issues_index = randd_field_hash['Bug编号'].to_i
issue.status_id = trans_status(randd_field_hash['Bug状态']) || IssueStatus.first.id
issue.tracker_id = Tracker.first.id
issue.priority_id = randd_field_hash['优先级'].to_i
@ -36,11 +36,11 @@ namespace :import_from_chandao do
issue.pm_project_id = args.pm_project_id
issue.pm_issue_type = 3
issue.save!
requirement_issue = Issue.find_by(project_issues_index: randd_field_hash['相关需求'].split('(#')[1].split(')')[0], pm_project_id: pm_project_id, pm_issue_type: 1) rescue nil
requirement_issue = Issue.find_by(project_issues_index: randd_field_hash['相关需求'].split('(#')[1].split(')')[0], pm_project_id: args.pm_project_id, pm_issue_type: 1) rescue nil
if requirement_issue.present?
requirement_issue.pm_links.find_or_create_by(be_linkable_type: 'Issue', be_linkable_id: issue.id)
end
task_issue = Issue.find_by(project_issues_index: randd_field_hash['相关任务'].split('(')[1].split(')')[0], pm_project_id: pm_project_id, pm_issue_type: 2) rescue nil
task_issue = Issue.find_by(project_issues_index: randd_field_hash['相关任务'].split('(')[1].split(')')[0], pm_project_id: args.pm_project_id, pm_issue_type: 2) rescue nil
if task_issue.present?
task_issue.pm_links.find_or_create_by(be_linkable_type: 'Issue', be_linkable_id: issue.id)
end