diff --git a/lib/tasks/batch_add_issues.rake b/lib/tasks/batch_add_issues.rake index 673d6a1a0..40b8fb3cd 100644 --- a/lib/tasks/batch_add_issues.rake +++ b/lib/tasks/batch_add_issues.rake @@ -175,7 +175,9 @@ namespace :batch_add_issues do # Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open lists.each do |issue| next if issue['pull_request'].present? - created_issue = Issue.find_by(project_id: project.id, subject: issue['title']) + title = issue['title'] + title = title[0..190] if title.size > 190 + created_issue = Issue.find_by(project_id: project.id, subject: title) unless created_issue.present? priority = [1, 2, 3, 4].include?(issue['priority'].to_i) ? issue['priority'].to_i : 2 issue_status = ["", "open", "progressing", "", "", "closed", "rejected"].index(issue['state']) @@ -211,9 +213,6 @@ namespace :batch_add_issues do end end - - title = issue['title'] - title = title[0..190] if title.size > 190 issue_params = { :status_id => issue_status, :priority_id => priority,