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

Using the Reportable REST API - how do I filter workitems by type?

I'm trying to get my head around the API for Rational Team Concert, so far I'd sum it up the experience of trying to extract data  from RTC as like trying to get blood from a stone.

Eventually I found my way to what I believe is the documentation for the APIs:

https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI

First thing my "hello world" test was to try get a list of all workitems, I ended up with this:

/ccm/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='MyProjectArea']/(summary|type/name|id)

I then wanted to do something a little more useful ... just pull defects:

/ccm/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='MyProjectArea' and type/name='Defect']/(summary|type/name|id)

This returns an internal server error: HTTP Status 500 - CRRED8022E: Non Queryable Field: type/name

I've tried filtering by type=Defect, type=defect, and get a different error: CRRED0105E: Unsupported type name: com.ibm.team.workitem.WorkItemType


Question 1: How do I filter workitems by type?

Question 2: Is there some better documentation around how to use this API? I haven't found any information on how I can automate authentication to the API yet either, so far I'm cheating by using the cookies from a manually authenticated session in my browser.

1 vote


Accepted answer

Permanent link
Hi David,

As you found out, you can't filter work items by the type name, but you can filter on the type *id* instead, i.e.

/ccm/rpt/repository/workitem?fields=workitem/workItem[type/id=<type_id>]/(summary|type/name|id)

That's also the case for the other examples that Subramanya mentioned - you can't filter on the state or severity name, but you can filter on their ID.

Unfortunately, we don't really have any documentation about this aside from the wiki page that you already found.  In terms of authentication, it would depend on how you're accessing the API - e.g., is it a Java program, a script...?  Authentication for the reportable REST API is the same as for any other REST APIs on the server, so you might be able to search the forums to figure out how to authenticate, depending on what method you're using.  For example, here's a wiki article with some examples for Perl -

https://jazz.net/library/article/1086/

And here's a forum post about how it works using curl -

https://jazz.net/forum/questions/17204/problem-using-curl-to-access-work-item-api


Ralph Schoon selected this answer as the correct answer

1 vote

Comments

thanks a lot for this hint, it worked for me! 


One other answer

Permanent link
As far as I know, not all the properties in RTC are allowed in filtering and this is one among them. (Other examples - state/name='New' or severity/name='Major')

You will see same error for
https://server:port/ccm/rpt/repository/workitem?fields=workitem/workItem[state/name='New']/(summary|projectArea/(name)|state/(name)|severity/(name))

I have not found any documentation apart from https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#Field_selection_and_filtering

2 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
× 11,084
× 241

Question asked: Jun 18 '15, 12:53 p.m.

Question was seen: 8,894 times

Last updated: Jan 12 '21, 5:29 a.m.

Confirmation Cancel Confirm