Bug 271069 - Predefined sort order not operating with Bugzilla when custom priorities are used
Summary: Predefined sort order not operating with Bugzilla when custom priorities are ...
Status: RESOLVED DUPLICATE of bug 242739
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All Windows Vista
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Mylyn Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-02 18:43 EDT by Randall Becker CLA
Modified: 2011-09-28 06:04 EDT (History)
3 users (show)

See Also:


Attachments
mylyn/context/zip (7.31 KB, application/octet-stream)
2010-01-20 15:20 EST, Frank Becker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Randall Becker CLA 2009-04-02 18:43:26 EDT
When using a Bugzilla 3.2.2 repository on a query, the sort selection does appear to have any effect if the priorities do not conform to the "out of box" values (i.e., P1, P2, P3, etc.) . This applies to any sort order. This occurs up to and including Mylyn 3.0.5 and up to and including Eclipse 3.3.3. The Bugzilla sort order in our configuration is:

Now - Immediate Resolve (100)
ASAP (200)
Soonest (300)
Critical - Time Critical(400)
Normal (500 - Default value)  
Time Permitting (600) 
ALAP (700)
Wish (800)

Would it be possible to sort by the Bugzilla sort key?

Thanks,

Randall
Comment 1 Robert Elves CLA 2010-01-04 12:02:21 EST
Unfortunately we don't get the sort key in the configuration but we can work with the bugzilla developers to add this support so that clients can sort values appropriately.
Comment 2 Frank Becker CLA 2010-01-11 15:15:20 EST
(In reply to comment #1)
> Unfortunately we don't get the sort key in the configuration but we can work
> with the bugzilla developers to add this support so that clients can sort
> values appropriately.

Rob,

actual the configuration fields for priority, bug_severity, rep_platform, op_sys, resolution and bug_status are orderd by the sortkey. (use of Fields.pm get_legal_field_values). So we know that the first Entry has the lowest sortkey and can build an mylyn internal sortkey starting by 1 with increment of 1.

or 

should we use the following WebService function:

 bug #506559 "WebService function to get information about fields (Bug.fields)" which is in the upcoming Bugzilla 3.6 version?

Thougths?
Comment 3 Robert Elves CLA 2010-01-14 16:47:38 EST
(In reply to comment #2)
> (In reply to comment #1)
> > Unfortunately we don't get the sort key in the configuration but we can work
> > with the bugzilla developers to add this support so that clients can sort
> > values appropriately.
> 
> Rob,
> 
> actual the configuration fields for priority, bug_severity, rep_platform,
> op_sys, resolution and bug_status are orderd by the sortkey. (use of Fields.pm
> get_legal_field_values). So we know that the first Entry has the lowest sortkey
> and can build an mylyn internal sortkey starting by 1 with increment of 1.
> 

Frank, this sound right at this point. Do you want to look into a solution based on deriving the sortkey from the order presented in the configuration?
Comment 4 Frank Becker CLA 2010-01-14 17:02:59 EST
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > Unfortunately we don't get the sort key in the configuration but we can work
> > > with the bugzilla developers to add this support so that clients can sort
> > > values appropriately.
> > 
> > Rob,
> > 
> > actual the configuration fields for priority, bug_severity, rep_platform,
> > op_sys, resolution and bug_status are orderd by the sortkey. (use of Fields.pm
> > get_legal_field_values). So we know that the first Entry has the lowest sortkey
> > and can build an mylyn internal sortkey starting by 1 with increment of 1.
> > 
> 
> Frank, this sound right at this point. Do you want to look into a solution
> based on deriving the sortkey from the order presented in the configuration?

Yes, but I want first finish bug#272207.
Comment 5 Frank Becker CLA 2010-01-20 15:20:24 EST
I think I found the problem. We need a mapping between the internal used priorities (P1-P5) and the defined values from the configuration.

So I mark this as duplicate of bug# 242739.

The order in the Attributeeditor is correct,  in the Tasklist (TaskComparator) we use the ITask interface.

But ITask has no support for mapping custom priorities to the PriorityLevel. AbstractTask use the PriorityLevel as priority.

I think we should change the ITask interface to support mapping of priority to PriorityLevel and separate field for the custom priority fit information about the sortorder.

Thoughts?
Comment 6 Frank Becker CLA 2010-01-20 15:20:31 EST
Created attachment 156701 [details]
mylyn/context/zip
Comment 7 Robert Elves CLA 2010-01-21 17:42:40 EST
(In reply to comment #5)
> I think I found the problem. We need a mapping between the internal used
> priorities (P1-P5) and the defined values from the configuration.
> 
> So I mark this as duplicate of bug# 242739.
> 
> The order in the Attributeeditor is correct,  in the Tasklist (TaskComparator)
> we use the ITask interface.
> 
> But ITask has no support for mapping custom priorities to the PriorityLevel.
> AbstractTask use the PriorityLevel as priority.
> 
> I think we should change the ITask interface to support mapping of priority to
> PriorityLevel and separate field for the custom priority fit information about
> the sortorder.
> 
> Thoughts?

Could do something along these lines. Just thinking of options that don't involve changing ITask....what about retrieving a Comparable from the corresponding connectorUI given the priority string?
Comment 8 Shawn Minto CLA 2010-01-21 17:58:17 EST
Rob, the connector could try to use the Rank attribute on ITask if it can map the string to a number.  This attribute is used as a part of the default sort order, so it could just work for new users.
Comment 9 Robert Elves CLA 2010-01-21 18:46:36 EST
(In reply to comment #8)
> Rob, the connector could try to use the Rank attribute on ITask if it can map
> the string to a number.  This attribute is used as a part of the default sort
> order, so it could just work for new users.

Yes we could leverage Rank for this, interesting idea.  So what's being proposed is:

* If the configuration priorities are not P1-P5 (this implies a custom configuration)
** Upon retrieval of priority for a task from the server, determine where it sits numerically according to the custom priorities list
** Create a TaskAttribute.RANK attribute with the value appropriate priority ordinal

Frank what do you think of this strategy?
Comment 10 Steffen Pingel CLA 2011-09-28 06:04:20 EDT
Let's track this on bug 242739.

*** This bug has been marked as a duplicate of bug 242739 ***