Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 242739

Summary: add support for custom priority levels (ie. if not using P1-P5)
Product: z_Archived Reporter: Elliott Baron <ebaron>
Component: MylynAssignee: Frank Becker <eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P1 CC: eclipse, joakim.lundborg, kendl, peter.kullmann, rahul.som, robert.elves, rsbecker, steffen.pingel, thomas.g.hatley
Version: unspecifiedKeywords: noteworthy, plan
Target Milestone: 3.7   
Hardware: All   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip
none
mylyn/context/zip none

Description Elliott Baron CLA 2008-07-31 11:13:31 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. Import a task from https://partner-bugzilla.redhat.com
2. Check priority level


More information:
When priority levels are not P1-P5 and are for instance urgent, high, medium and low (as RHBZ uses), Mylyn defaults to a P3 priority when interpreting the priority.
Comment 1 Elliott Baron CLA 2008-07-31 11:28:01 EDT
Specifically, mouse-over the bug in the task list to see Priority: P3
Comment 2 Robert Elves CLA 2008-09-24 00:31:59 EDT
Assuming the order of priorities returned in the configuration is consistent with the priority order of a regular install, we should be able to map them directly to the mylyn P1-P5 more appropriately. This will require additional support in the client for holding these custom priorities and sending the appropriate value back to the server upon submission.

Comment 3 Robert Elves CLA 2009-01-15 12:32:28 EST
*** Bug 260982 has been marked as a duplicate of this bug. ***
Comment 4 Steffen Pingel CLA 2009-09-18 13:54:06 EDT
*** Bug 289729 has been marked as a duplicate of this bug. ***
Comment 5 Steffen Pingel CLA 2011-09-28 06:04:21 EDT
*** Bug 271069 has been marked as a duplicate of this bug. ***
Comment 6 Steffen Pingel CLA 2011-09-28 06:05:02 EDT
*** Bug 283477 has been marked as a duplicate of this bug. ***
Comment 7 Steffen Pingel CLA 2011-09-28 06:05:36 EDT
I recommend using the same strategy as the Trac connector: Each custom priority value is mapped to P1-P5 based on it's rank. The implementation is in TracRepositoryConnector.getTaskPriority(String priority, TracPriority[] tracPriorities).
Comment 8 Randall Becker CLA 2011-09-28 22:10:16 EDT
I like that approach, Steffen
Comment 9 Frank Becker CLA 2011-10-08 13:22:43 EDT
Now I have fixed the failing tests.

So we can close this.
Comment 10 Frank Becker CLA 2011-10-08 13:23:14 EDT
Created attachment 204805 [details]
mylyn/context/zip
Comment 11 Steffen Pingel CLA 2011-10-14 18:08:28 EDT
I got this exception while opening bug 168204 in a debug workspace. Frank, can you please look into this and add a test case? Thanks!

!ENTRY org.eclipse.mylyn.tasks.ui 4 0 2011-10-15 00:05:37.991
!MESSAGE Error creating task editor part: "org.eclipse.mylyn.tasks.ui.editors.parts.summary"
!STACK 0
java.lang.NullPointerException
	at org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector$1.getPriorityLevel(BugzillaRepositoryConnector.java:669)
	at org.eclipse.mylyn.internal.tasks.ui.editors.PriorityAttributeEditor.updateEditor(PriorityAttributeEditor.java:85)
	at org.eclipse.mylyn.internal.tasks.ui.editors.PriorityAttributeEditor.refresh(PriorityAttributeEditor.java:67)
	at org.eclipse.mylyn.internal.tasks.ui.editors.PriorityAttributeEditor.createControl(PriorityAttributeEditor.java:52)
	at org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorSummaryPart.addAttributeWithIcon(TaskEditorSummaryPart.java:110)
	at org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorSummaryPart.createControl(TaskEditorSummaryPart.java:171)
	at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage.initializePart(AbstractTaskEditorPage.java:1301)
	at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage.access$7(AbstractTaskEditorPage.java:1293)
Comment 12 Frank Becker CLA 2011-10-15 12:48:39 EDT
Steffen,

I can not reproduce this!

But I have create review http://review.mylyn.org/85.

I did not know why the configuration is null here. But I create an fallback to the default Levels in this case.
Comment 13 Frank Becker CLA 2011-10-15 12:48:41 EDT
Created attachment 205264 [details]
mylyn/context/zip
Comment 14 Steffen Pingel CLA 2011-10-15 15:26:59 EDT
Thanks. Can you add a test case for the mapping?
Comment 15 Frank Becker CLA 2011-10-16 03:32:40 EDT
Tests are now under review in Patch Set 2 of the review
Comment 16 Frank Becker CLA 2011-10-16 05:10:56 EDT
Steffen,

I have "Publish and Submit" the Patch Set 2 but I can not found it in the http://git.eclipse.org/c/mylyn/org.eclipse.mylyn.tasks.git/

Do you know what is the reason for this?
Comment 17 Steffen Pingel CLA 2011-10-18 03:06:04 EDT
The Gerrit instance is not connected to the Eclipse.org Git repository, it works of a mirror that is updated frequently. To merge a change you have to push it to Eclipse: http://dev.eclipse.org/mhonarc/lists/mylyn-dev/msg01414.html.
Comment 18 Frank Becker CLA 2011-10-19 15:12:42 EDT
changes are now commited, so i close this bug.