Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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?

0 votes



3 answers

Permanent link
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

1 vote

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

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

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


Permanent link
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)



0 votes


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


0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,934
× 515
× 478
× 369

Question asked: Oct 03 '12, 6:46 a.m.

Question was seen: 9,588 times

Last updated: Jun 24 '13, 3:11 p.m.

Confirmation Cancel Confirm