@@ -39,6 +39,17 task :migrate_from_mantis => :environment do | |||||
39 | 90 => closed_status # closed |
|
39 | 90 => closed_status # closed | |
40 | } |
|
40 | } | |
41 |
|
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 | } | |||
|
50 | ||||
|
51 | TARGET_TRACKER = Tracker.find :first | |||
|
52 | ||||
42 | default_role = Role.find_by_position(3) |
|
53 | default_role = Role.find_by_position(3) | |
43 | manager_role = Role.find_by_position(1) |
|
54 | manager_role = Role.find_by_position(1) | |
44 | developer_role = Role.find_by_position(2) |
|
55 | developer_role = Role.find_by_position(2) | |
@@ -289,8 +300,7 task :migrate_from_mantis => :environment do | |||||
289 | i = Issue.new :project_id => projects_map[bug.project_id], |
|
300 | i = Issue.new :project_id => projects_map[bug.project_id], | |
290 | :subject => encode(bug.summary), |
|
301 | :subject => encode(bug.summary), | |
291 | :description => encode(bug.bug_text.full_description), |
|
302 | :description => encode(bug.bug_text.full_description), | |
292 | # TODO |
|
303 | :priority => PRIORITY_MAPPING[bug.priority], | |
293 | :priority => Enumeration.get_values('IPRI').first, |
|
|||
294 | :created_on => bug.date_submitted, |
|
304 | :created_on => bug.date_submitted, | |
295 | :updated_on => bug.last_updated |
|
305 | :updated_on => bug.last_updated | |
296 | i.author = User.find(users_map[bug.reporter_id] || :first) |
|
306 | i.author = User.find(users_map[bug.reporter_id] || :first) | |
@@ -298,8 +308,7 task :migrate_from_mantis => :environment do | |||||
298 | i.category = IssueCategory.find_by_project_id_and_name(i.project_id, bug.category) unless bug.category.blank? |
|
308 | i.category = IssueCategory.find_by_project_id_and_name(i.project_id, bug.category) unless bug.category.blank? | |
299 | i.fixed_version = Version.find_by_project_id_and_name(i.project_id, bug.fixed_in_version) unless bug.fixed_in_version.blank? |
|
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 | i.status = STATUS_MAPPING[bug.status] || default_status |
|
310 | i.status = STATUS_MAPPING[bug.status] || default_status | |
301 | # TODO |
|
311 | i.tracker = TARGET_TRACKER | |
302 | i.tracker = Tracker.find(:first) |
|
|||
303 | next unless i.save |
|
312 | next unless i.save | |
304 | issues_map[bug.id] = i.id |
|
313 | issues_map[bug.id] = i.id | |
305 | print '.' |
|
314 | print '.' |
General Comments 0
You need to be logged in to leave comments.
Login now