diff options
Diffstat (limited to 'lib/tasks/migrate_from_mantis.rake')
-rw-r--r-- | lib/tasks/migrate_from_mantis.rake | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake index 1040dbb0a..d312238c0 100644 --- a/lib/tasks/migrate_from_mantis.rake +++ b/lib/tasks/migrate_from_mantis.rake @@ -25,15 +25,15 @@ task :migrate_from_mantis => :environment do module MantisMigrate - DEFAULT_STATUS = IssueStatus.default + new_status = IssueStatus.find_by_position(1) assigned_status = IssueStatus.find_by_position(2) resolved_status = IssueStatus.find_by_position(3) feedback_status = IssueStatus.find_by_position(4) closed_status = IssueStatus.where(:is_closed => true).first - STATUS_MAPPING = {10 => DEFAULT_STATUS, # new + STATUS_MAPPING = {10 => new_status, # new 20 => feedback_status, # feedback - 30 => DEFAULT_STATUS, # acknowledged - 40 => DEFAULT_STATUS, # confirmed + 30 => new_status, # acknowledged + 40 => new_status, # confirmed 50 => assigned_status, # assigned 80 => resolved_status, # resolved 90 => closed_status # closed @@ -317,8 +317,8 @@ task :migrate_from_mantis => :environment do i.author = User.find_by_id(users_map[bug.reporter_id]) i.category = IssueCategory.find_by_project_id_and_name(i.project_id, bug.category[0,30]) unless bug.category.blank? i.fixed_version = Version.find_by_project_id_and_name(i.project_id, bug.fixed_in_version) unless bug.fixed_in_version.blank? - i.status = STATUS_MAPPING[bug.status] || DEFAULT_STATUS i.tracker = (bug.severity == 10 ? TRACKER_FEATURE : TRACKER_BUG) + i.status = STATUS_MAPPING[bug.status] || i.status i.id = bug.id if keep_bug_ids next unless i.save issues_map[bug.id] = i.id |