It's all about the answers!

Ask a question

Query work items not approved by anyone

mark byrd (14712330) | asked Feb 11 '13, 10:42 a.m.
I know how to query work items rejected by anyone, pending by anyone, or approved by anyone. Is there a way to query work items not approved by anyone?

Millard Ellingsworth commented Feb 11 '13, 6:21 p.m.

Do you mean items that carry no approvals at all? Or the case where all approvals are pending approvals (neither rejected nor approved yet)? 

mark byrd commented Feb 12 '13, 7:42 a.m.

I mean a situation where I've customized operation behavior to require approvals for code delivery, where I require a work item to be approved by 1 person that's been assigned the approval role. A developer will request approval from multiple people with the approval role.  I want to query and find work items where no one has approved the work item. I guess that could also be stated as "where all approvals are pending approvals (neither rejected nor approved yet)". 

mark byrd commented Feb 13 '13, 9:39 a.m.

I notice that the "quick Information" section of a work item has an approval's approved, rejected, pending counts. Can a query access that info? 

One answer

permanent link
Millard Ellingsworth (2.5k12431) | answered Feb 12 '13, 1:04 p.m.
Did you look at the query condition "Approval Descriptors"? One of the options is Cumulative State.

I just created a simple query that looks for Approval Descriptors > Cumulative State is Pending and it found a work item to which I had added an approval (that had not been processed). It did not return items that had no approvals nor items that were approved or rejected. It did return items that had multiple approval where at least one was Pending.

Is this what you are looking for?

mark byrd commented Feb 13 '13, 8:06 a.m.

Thanks for responding. I've tried "Approval Descriptors" but still did not get what I needed.  Excluding an item with no approvals is good, but I need to also exclude an item if any of it's approvals are approved, as long as none of its approvals are rejected.

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.