Can I use work item type as query parameter in Reportable REST API?
3 answers
https://servername:9443/ccm/rpt/repository/workitem?fields=workitem/workItem[type/id='defect']/id
Comments
I tried to leverage Brian Fleming's example (above) for a solution I'm working on using RTC 4.0.1. I wasn't able to get that syntax to work. But the following worked for me using RTC 4.0.1.
According to http://open-services.net/pub/Main/ReportingHome/Reportable_Rest_Services_Interfaces-OSLC_Submission.pdf (page 19, section 4.3.2.4) you have to add "@" or "attribute::" when filtering on an attribute versus a child element.
In my example below, @id for type worked. Without @ didn't work in this case.
For some reason unknown to me, @name for type didn't work (with or without @). So I had to stick with matching on the id.
1 vote
https://<server>:<port>/ccm/rpt/repository/workitem?fields=workitem/workItem/(type[ @ id='source_code_ci_-_micses']/*|id|state/*)
(Note that I added a space before and after the "@" above to keet the answer formatting from being distorted after I submit the answer.)
1 vote
I did get Brian's example to work for me after all.
fields=workitem/workItem[type/id='source_code_ci_-_micses']/(id|state/*)
My example works if you need to filter at a lower level.
1 vote