Github issues迁移,更新时间固定
This commit is contained in:
parent
326dcc56ab
commit
761021d191
|
@ -178,14 +178,14 @@ namespace :batch_add_issues do
|
|||
title = issue['title']
|
||||
title = title[0..190] if title.size > 190
|
||||
created_issue = Issue.find_by(project_id: project.id, subject: title)
|
||||
issue_created_at = issue['created_at']
|
||||
issue_updated_at = issue['updated_at']
|
||||
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'])
|
||||
issue_status = 1 if issue_status.nil?
|
||||
user_login = issue['user']['login']
|
||||
user_login = user_login[0..20] if user_login.size > 29
|
||||
issue_created_at = issue['created_at']
|
||||
issue_updated_at = issue['updated_at']
|
||||
username = "gh-#{user_login}"
|
||||
user = User.find_by(login: username)
|
||||
unless user.present?
|
||||
|
|
Loading…
Reference in New Issue