diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-08-13 16:48:43 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-08-13 16:48:43 +0000 |
commit | 29c623fa5855ff029fc856ecbcf5947c020bd839 (patch) | |
tree | 2709ef322769854250920897cc34412463d11551 /lib/tasks | |
parent | 343cab8148b0313dd7cf5368f9f177698443f682 (diff) | |
download | redmine-29c623fa5855ff029fc856ecbcf5947c020bd839.tar.gz redmine-29c623fa5855ff029fc856ecbcf5947c020bd839.zip |
Mantis importer: added priorities mapping.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@628 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/migrate_from_mantis.rake | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake index ed9b07b3b..1ed4bcbb9 100644 --- a/lib/tasks/migrate_from_mantis.rake +++ b/lib/tasks/migrate_from_mantis.rake @@ -38,7 +38,18 @@ task :migrate_from_mantis => :environment do 80 => resolved_status, # resolved
90 => closed_status # closed
}
+
+ priorities = Enumeration.get_values('IPRI')
+ PRIORITY_MAPPING = {10 => priorities[1], # none
+ 20 => priorities[1], # low
+ 30 => priorities[2], # normal
+ 40 => priorities[3], # high
+ 50 => priorities[4], # urgent
+ 60 => priorities[5] # immediate
+ }
+ TARGET_TRACKER = Tracker.find :first
+
default_role = Role.find_by_position(3)
manager_role = Role.find_by_position(1)
developer_role = Role.find_by_position(2)
@@ -289,8 +300,7 @@ task :migrate_from_mantis => :environment do i = Issue.new :project_id => projects_map[bug.project_id],
:subject => encode(bug.summary),
:description => encode(bug.bug_text.full_description),
- # TODO
- :priority => Enumeration.get_values('IPRI').first,
+ :priority => PRIORITY_MAPPING[bug.priority],
:created_on => bug.date_submitted,
:updated_on => bug.last_updated
i.author = User.find(users_map[bug.reporter_id] || :first)
@@ -298,8 +308,7 @@ task :migrate_from_mantis => :environment do i.category = IssueCategory.find_by_project_id_and_name(i.project_id, bug.category) 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
- # TODO
- i.tracker = Tracker.find(:first)
+ i.tracker = TARGET_TRACKER
next unless i.save
issues_map[bug.id] = i.id
print '.'
|