braini75 / msproject_import

Redmine-Plugin: XML-Task-Importer for MS Project
9 stars 11 forks source link

priority_id custom field #6

Closed vitesseval closed 8 years ago

vitesseval commented 8 years ago

I have a question about priority_id. Is it a custom field or does it map to the default Priority field? The reason I ask is because I would like to change the mapping. I have a 4 point scale I have to follow like this: MS Project Priority == 1000 -> Redmine Priority 0 MS Project Priority >700 & <1000 -> Redmine Priority 1 MS Project Priority >300 & <700 -> Redmine Priority 2 MS Project Priority >0 & <300 -> Redmine Priority 3

It looks like your code would be very easy to modify to do this, but I am required to use the existing Priority field. Any help would be greatly appreciated & thanks for all of your hard work!

vitesseval commented 8 years ago

I modified some code in msproj_imp_helper.rb to get this working. I had to go through my enumerations to get the id numbers. I still can't complete the import. I get an error Error: ["Tracker is not included in the list"]. I'm not sure what list it's referring to. I'll open a new issue if I can't resolve on my own.

Here's the code I changed for what I wanted: priority = tasks.elements['Priority'].text if priority == "1000" task.priority_id = 15 #P0 elsif priority == "800" task.priority_id = 10 #P1 elsif priority == "500" task.priority_id = 11 #P2 else task.priority_id = 12 #P3 end