##// END OF EJS Templates
Fixed that Trac importer was creating duplicate custom values (#2506)....
Jean-Philippe Lang -
r2278:a4882467cbab
parent child
Show More
@@ -464,7 +464,6 namespace :redmine do
464 464 i.fixed_version = version_map[ticket.milestone] unless ticket.milestone.blank?
465 465 i.status = STATUS_MAPPING[ticket.status] || DEFAULT_STATUS
466 466 i.tracker = TRACKER_MAPPING[ticket.ticket_type] || DEFAULT_TRACKER
467 i.custom_values << CustomValue.new(:custom_field => custom_field_map['resolution'], :value => ticket.resolution) unless ticket.resolution.blank?
468 467 i.id = ticket.id unless Issue.exists?(ticket.id)
469 468 next unless Time.fake(ticket.changetime) { i.save }
470 469 TICKET_MAP[ticket.id] = i.id
@@ -516,14 +515,18 namespace :redmine do
516 515 end
517 516
518 517 # Custom fields
519 ticket.customs.each do |custom|
520 next if custom_field_map[custom.name].nil?
521 v = CustomValue.new :custom_field => custom_field_map[custom.name],
522 :value => custom.value
523 v.customized = i
524 next unless v.save
518 custom_values = ticket.customs.inject({}) do |h, custom|
519 if custom_field = custom_field_map[custom.name]
520 h[custom_field.id] = custom.value
525 521 migrated_custom_values += 1
526 522 end
523 h
524 end
525 if custom_field_map['resolution'] && !ticket.resolution.blank?
526 custom_values[custom_field_map['resolution'].id] = ticket.resolution
527 end
528 i.custom_field_values = custom_values
529 i.save_custom_field_values
527 530 end
528 531
529 532 # update issue id sequence if needed (postgresql)
General Comments 0
You need to be logged in to leave comments. Login now