It's all about the answers!

Ask a question

Query which filters work items with only approved approvals


Stefan Hoffmann (14421820) | asked Nov 03 '14, 1:53 a.m.
Hi,

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



permanent link
Eric Jodet (6.3k5111120) | answered Nov 03 '14, 4:14 a.m.
JAZZ DEVELOPER
 Hello Stefan,
query one: approval state is approved
query two: approval state is pending

Note: the query will only check the overall approval status, which means, are all approvals approved or not

Hope it helps,
Eric

Comments
Stefan Hoffmann commented Nov 03 '14, 4:24 a.m.

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.


Stefan Hoffmann commented Nov 03 '14, 4:25 a.m.

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.


Eric Jodet commented Nov 03 '14, 4:34 a.m.
JAZZ DEVELOPER

 Hello Stefan,

did a quick search on jazz.net and found that this could be a limitation in regards with queries and approvals.

What do you think?

Eric


Stefan Hoffmann commented Nov 03 '14, 5:25 a.m.

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,


Eric Jodet commented Nov 03 '14, 7:43 a.m.
JAZZ DEVELOPER

Stefan Hoffmann commented Nov 03 '14, 7:59 a.m.

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.

showing 5 of 6 show 1 more comments

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.