How to filter work item by state name using Reportable REST API
Accepted answer
As the error message says, state/name is not queryable, so you can't filter on it. The state IDs are static, so you could filter on that instead.
Michael Taylor selected this answer as the correct answer
Comments
Michael Taylor
commented Jun 24 '13, 1:54 p.m.
Thanks. It's wierd that it lets you filter on state name if you do the filtering at the next lowest level on state. I guess we'll just stick with the ID then.
Binoy D'costa
commented May 05 '15, 3:40 p.m.
Hi Alanna,
1
Greg Pflaum
commented May 05 '15, 10:26 p.m.
Binoy, for those 's' ids, use just the number: state/id='2'.
Binoy D'costa
commented May 07 '15, 2:49 p.m.
Unbelievable! WOW! Thanks so much. Not sure why I didn't think of it. :)
|
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.
Comments
The question field is playing havok with my URL formatting:
So far, I have only been able to filter by the State id:
https:// <server>:<port>/ccm/rpt/repository/workitem?fields=workitem/workItem[state/name='Approved']/(id|state/name)
Is there different syntax I can use to query by State name? If not, once the States are defined for a work item type, will the id's always be static at that point?
The following gives an error "CRRED8022E: Non Queryable Field: state/name":
Trying to list the URL again:
This is what doesn't work:
partial URL: fields=workitem/workItem[state/name='Approved']/(id|state/name)