RegisterLog In to Jazz.net dW

It's all about the answers!

Ask a question

Can I use work item type as query parameter in Reportable REST API?


Vladimir Amelin (579539) | asked Oct 03 '12, 6:46 a.m.
edited Nov 23 '12, 6:53 a.m.
RTC 3.0.1.x. What I need is to fetch all work items of particular type from all project areas. OSLC REST API is scoped to context (e.g. project area) so I have to use Reportable REST API. 
But
returns CRRED0105E: Unsupported type name: com.ibm.team.workitem.WorkItemType

Any ideas?

3 answers



link
Brian Fleming (9901214) | answered Nov 23 '12, 10:04 a.m.
edited Nov 23 '12, 10:24 a.m.
Type is a complex attribute and you need to specify you are filtering on the id of the type.  This works (in 4.0):
https://servername:9443/ccm/rpt/repository/workitem?fields=workitem/workItem[type/id='defect']/id


Comments
Michael Taylor commented Jun 24 '13, 11:24 a.m.

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.


Michael Taylor commented Jun 24 '13, 11:25 a.m.

EXAMPLE:

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.)


Michael Taylor commented Jun 24 '13, 3:11 p.m.

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.


link
Vivek Jain (11) | answered Nov 06 '12, 8:48 a.m.
When you try with below mention URL, it will show you all result, it is blank, will not catch type field. Still a open issue.

https://servername:9443/ccm/rpt/repository/workitem?fields=workitem/workItem/(id|type)




link
Vladimir Amelin (579539) | answered Nov 06 '12, 8:52 a.m.
 Hi Vivek,

I haven't managed to make WI type filters work in Reportable REST API, I had to use OSLC REST API (dc_type attribute).


Your answer


Register or log in to post your answer.