Github issues迁移,标记
This commit is contained in:
parent
eaf389ecea
commit
c6a38c06d0
|
@ -203,12 +203,15 @@ namespace :batch_add_issues do
|
||||||
UserExtension.create!(user_id: user.id)
|
UserExtension.create!(user_id: user.id)
|
||||||
puts "import_user batch success: phone #{phone} email: #{email}"
|
puts "import_user batch success: phone #{phone} email: #{email}"
|
||||||
end
|
end
|
||||||
|
issue_tags_value = []
|
||||||
if issue['labels'].present?
|
if issue['labels'].present?
|
||||||
issue['labels'].each do |tag|
|
issue['labels'].each do |tag|
|
||||||
project.issue_tags.find_or_create_by!(name: tag['name'], description: tag['description'], color: "##{tag['color']}")
|
label = project.issue_tags.find_or_create_by!(name: tag['name'], description: tag['description'], color: "##{tag['color']}")
|
||||||
|
issue_tags_value.push(label.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
title = issue['title']
|
title = issue['title']
|
||||||
title = title[0..190] if title.size > 190
|
title = title[0..190] if title.size > 190
|
||||||
issue_params = {
|
issue_params = {
|
||||||
|
@ -221,7 +224,7 @@ namespace :batch_add_issues do
|
||||||
:subject => title,
|
:subject => title,
|
||||||
:description => issue['body'],
|
:description => issue['body'],
|
||||||
# :blockchain_token_num,
|
# :blockchain_token_num,
|
||||||
:issue_tag_ids => [],
|
:issue_tag_ids => issue_tags_value.join(","),
|
||||||
:assigner_ids => [],
|
:assigner_ids => [],
|
||||||
:attachment_ids => [],
|
:attachment_ids => [],
|
||||||
:receivers_login => []
|
:receivers_login => []
|
||||||
|
|
Loading…
Reference in New Issue