RTC report REST API: how can I query all items which are not finalized for a year or more?
Hi!
I do some reporting stuff by the help of RTC's REST API.
For performance reasons, I want to skip all items which are finalized for a year or more.
In other words, I need to query for all items which are not finalized OR which has been finalized after a specific date.
So I need a positive filter like
resolutionDate > xxxx-xx-xx or resolutionDate is undefined
or
!(resolutionDate < xxxx-xx-xx)
The latter one doesn't work because there seems to be no logical negation.
The first one doesn't work because I have no idea how I can query for items whose resolutionDate is undefined.
Does anybody has an idea how I can query all items which are not resolved OR are not resolved for more than a year?
Thanks!
Daniel
One answer
You can translate "resolutionDate is undefined" to some other condition. For example, if Resolution Date is not set, it means that the work item is not in the Resolved state, so you can use a condition "state/id != resolved_state_id".
Note 1: Neither state/name nor state/group appears to be supported.
Note 2: You can consider using "state/id in (new_state_id, in_progress_state_id, ...)" instead. In either case, if you are dealing with multiple work item types and multiple workflow, you need to take all the states into consideration.
The filter may become quite complicated, but at least it is doable.