Query which filters work items with only approved approvals
I haven't found a way to filter work items in a query which are completely approved, so have multiple approvals which are in the "approved" state.
Example:
WI 1, two approvals, one in "approved" state, one in "pending" state
WI 2: two approvals, both in "approved" state, WI is completely approved
Needed Query:
Query one: Display WI which have only "approved" approvals (completely approved) -> WI 2
Query two: Display WI which have not only "approved" approvals (not completely approved/rejected) -> WI 1
Stefan
One answer
Comments
Hi Eric, I can not follow your solution for query one.
I set the filter on "Approval State is: Approved"
Now WI 1 (and WI 2, of course) is found, as it has one approved approval. Seems like the "is Approved" condition is happy when it find one and is ignoring the other approvals.
Thats not what I want to do, I want the overall state of the work item, not if one single approval with a specific resolution exists at the work item.
Hi Eric, I can not follow your solution for query one.
I set the filter on "Approval State is: Approved"
Now WI 1 (and WI 2, of course) is found, as it has one approved approval. Seems like the "is Approved" condition is happy when it find one and is ignoring the other approvals.
Thats not what I want to do, I want the overall state of the work item, not if one single approval with a specific resolution exists at the work item.
Hello Stefan,
Hi,
The problem with 274343 is at some point logical, as there are two conditions invoked, which are running over a collection (of approvals), but each for themselve, not together.
I for myself have one single condition "Approval is: [Approved]". This condition runs internal over a collection of approvals. Thing is that it break out of the loop after the first match.
So, another try for me was to inverse the logic and say
Approval is not: [Pending]
Does also not work, as one approval is "Approved", so the condition is fulfilled.
To summarize: The condition call it "Approval", but in fact it is more a "Is there an approval" with no way to control the loop behaviour, to change the "is there" to an "are all".
The possibility for a big (and generic) NOT for each single condition could do the magic, it would inverse the loop behaviour.
At the end it is frustrating that such a simple (and seen from the idea of aprovals as state for a work item) condition can not be handled,
Hello Stefan,
Hi Eric,
I don't think so. 188233 talks about the state of a single approval descriptor (with multiple approvers). This is already solved by the "Approval Descriptors->Cumulative State" condition. You should close this workitem :-).
I have the same problem on the next hierarchy level, the state over all approval descriptors.