Workitem query for items where I have the action
I am trying to write a workitem query that will show list workitems where I have action to take (and I am not waiting on someone else to review/approve). That is defined as workitems that are Owned By "Current User" and have Status "In Progress" and either have no approval records, no approval records with a user assigned or no pending approvals.
My Work =
(In Progress AND Owned by Current User)
AND
(An Approval record does not exist
OR
An Approval record is unassigned*
OR
An Approval record is NOT pending)
* Not assigned to any user rather than assigned to the Unassigned user
From experimentation, it appears that if an approval record exists but does not yet have an approver assigned, this is implicitly considered to be in the "Pending" state. If I assign the user "Unassigned", the approval record's state is explicitly "Pending", but when I want to assign a real approver, I need to delete the Unassigned one, as I cannot modify the approver. Basically the query works until such time as some creates an approval but has not yet put a name against the approval, at which point the query no longer finds it - this specific case we also want to avoid.
So the sticking points seem to be being able to query "the existence of an Approval record" and an "Approval record that has no user assigned as approver" .
Any suggestions gratefully received.
Rachel
My Work =
(In Progress AND Owned by Current User)
AND
(An Approval record does not exist
OR
An Approval record is unassigned*
OR
An Approval record is NOT pending)
* Not assigned to any user rather than assigned to the Unassigned user
From experimentation, it appears that if an approval record exists but does not yet have an approver assigned, this is implicitly considered to be in the "Pending" state. If I assign the user "Unassigned", the approval record's state is explicitly "Pending", but when I want to assign a real approver, I need to delete the Unassigned one, as I cannot modify the approver. Basically the query works until such time as some creates an approval but has not yet put a name against the approval, at which point the query no longer finds it - this specific case we also want to avoid.
So the sticking points seem to be being able to query "the existence of an Approval record" and an "Approval record that has no user assigned as approver" .
Any suggestions gratefully received.
Rachel