##// END OF EJS Templates
Mantis importer: added priorities mapping....
Jean-Philippe Lang -
r625:29c623fa5855
parent child
Show More
@@ -38,7 +38,18 task :migrate_from_mantis => :environment do
38 38 80 => resolved_status, # resolved
39 39 90 => closed_status # closed
40 40 }
41
42 priorities = Enumeration.get_values('IPRI')
43 PRIORITY_MAPPING = {10 => priorities[1], # none
44 20 => priorities[1], # low
45 30 => priorities[2], # normal
46 40 => priorities[3], # high
47 50 => priorities[4], # urgent
48 60 => priorities[5] # immediate
49 }
41 50
51 TARGET_TRACKER = Tracker.find :first
52
42 53 default_role = Role.find_by_position(3)
43 54 manager_role = Role.find_by_position(1)
44 55 developer_role = Role.find_by_position(2)
@@ -289,8 +300,7 task :migrate_from_mantis => :environment do
289 300 i = Issue.new :project_id => projects_map[bug.project_id],
290 301 :subject => encode(bug.summary),
291 302 :description => encode(bug.bug_text.full_description),
292 # TODO
293 :priority => Enumeration.get_values('IPRI').first,
303 :priority => PRIORITY_MAPPING[bug.priority],
294 304 :created_on => bug.date_submitted,
295 305 :updated_on => bug.last_updated
296 306 i.author = User.find(users_map[bug.reporter_id] || :first)
@@ -298,8 +308,7 task :migrate_from_mantis => :environment do
298 308 i.category = IssueCategory.find_by_project_id_and_name(i.project_id, bug.category) unless bug.category.blank?
299 309 i.fixed_version = Version.find_by_project_id_and_name(i.project_id, bug.fixed_in_version) unless bug.fixed_in_version.blank?
300 310 i.status = STATUS_MAPPING[bug.status] || default_status
301 # TODO
302 i.tracker = Tracker.find(:first)
311 i.tracker = TARGET_TRACKER
303 312 next unless i.save
304 313 issues_map[bug.id] = i.id
305 314 print '.'
General Comments 0
You need to be logged in to leave comments. Login now