问题
I think this question may be spawned from lack of knowledge, but here we go...
I am trying to write a new team query (using the new query option of team explorer, in VS 2010) what I want is fairly simple; essentially a list of work items whos [Completed Work] value exceeds the [Original Estimate] field value. In other words WIs that have exceeded their original estimates.
The VS 2010 view does not seem to have an option to show the WIQL being generated under the hood, so I'll have to describe what I have done/am trying to do via the VS 2010 UI.
Clauses are fairly standard to start;
Team Project = @Project
And Work Item type = Task
And State = [Any]
I have added a caluse (to remove any work items without an estimate)
And Orignial Estimate <> ''
I thought the next step would be simplicity itself; adding a clause along the lines of
And Completed Work > Original Estimate
But no matter how I try to write "Original Estimate" in the value filed of the UI (as Original Estimate, [Original Estimate] and many other variations) to date all I get is a line indicating a that Input string was not in a correct format.
Is this possible? I would have thought simple comparisons to the value of another WI field would be supported, are they? If it is possible what the he** is the syntax?
Thanks.
Update
I had a look at the Task template and confirmed that both Original Estimate and Remaining Work are doubles and have the following full names (should that be relivant)
Friendly Name Type Ref Name
Original Estimate Double Microsoft.VSTS.Scheduling.OriginalEstimate
Remaining Work Double Microsoft.VSTS.Scheduling.RemainingWork
回答1:
You simply need the >= [Field] operator instead of the >= operator:
Original Estimate >= [Field] Completed Work
来源:https://stackoverflow.com/questions/5870559/how-do-i-write-a-tfs-2010-work-item-query-clause-whos-value-is-a-field-value