It's all about the answers!

Ask a question

Is it possible to use work item type as a filter attribute in a query thru Reportable REST API?


Martin Sarro (1122) | asked May 02 '13, 5:19 a.m.
Hi folks!
It works for me when I attempt to query by filtering on ProjectArea attribute or any workitem attributes different than Type (or even Status). But when I add a type as a filter condition the query returns an Error 500: CRRED8029E. Not valid query"
i.e.
It works when I use any other attribute as a query filter:
Filter by PROJECT AREA:
RESULT (OK)
Filter by PROJECT AREA and OWNER:
https://localhost:9443/ccm/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='MyProjectArea' and owner/name='JOHN SMITH']/(id|summary|description|type/name)&size=10000
RESULT (OK)
But it doesn't work when I add the "WorkItem Type" as a filter:
RESULT (KO): Error 500: CRRED8029E: Consulta no válida: type/name='Fase'
It doesn't work for any of the types. The "type name" I used in  the query is correct since I use the same literal as defined in the Configuration Data > Workitems > Types and Attributes.
Is there someting wrong thru the query? Any idea about how to filter by type?
Thanks in advance!

2 answers



permanent link
Alanna Zito (1.3k3) | answered May 03 '13, 3:37 p.m.
JAZZ DEVELOPER
Hi Martin,

Although type/name is not queryable, type/id is - so you could use this attribute to filter by type instead, e.g.

https://localhost:9443/jazz/rpt/repository/workitem?fields=workitem/workItem[type/id="com.ibm.team.apt.workItemType.story"]/(id|summary|type/(id|name))

You can find the type IDs in the same place you found the literal names.

Comments
Martin Sarro commented May 06 '13, 4:16 a.m.
Thanx Alanna for your response!
I still get the same "Error 500: CRRED8029E: Invalid Query" even using the queryable "type/id" attribute.
I guess it could be due to the RTC version, since this same QUERY works in site Jazz.net (using RTC v4), but I can't make it works in my RTC 3.0.1.
Have you ever tried this in RTC 3.0.1?
On the other hand, My query works without type filter only by using the https://localhost:9443/ccm/rpt/repository/workitem (ccm), since pointing to JAZZ doesn't work.
Any other idea?
Thanx again!

Alanna Zito commented May 06 '13, 9:15 a.m.
JAZZ DEVELOPER

I tried out that URL with RTC 4.0.x, so it's possible that it doesn't work with 3.0.x.  If that's the case, then I'm afraid I don't know of any other way to filter by the work item type.

Re: using "jazz" vs "ccm" - I just copied the URL directly from my local server, which was using jazz as the context root - I should have updated it to the use the standard "ccm" instead.  You should use whatever context root your server is using. 


Martin Sarro commented May 07 '13, 10:22 a.m.
Yep, sounds like I'll have to do a work-around until get RTC upgraded to v4.0.1.
I'm thinking about building a QUERY in RTC with all fields I need to report and execute it thru CURL command.
Thanx again!
Martin

permanent link
Kot T. (1.5k11219) | answered May 03 '13, 12:16 p.m.
JAZZ DEVELOPER
workitem/type/name is non-queryable field. The error message in my case is different than the one you got above. In my test, it shows "CRRED8022E: Non Queryable Field: type/name"

According to https://jazz.net/forum/questions/106736/where-are-reportable-rest-api-queryable-fields-documented, no documentation on the list of queryable versus non-queryable fields is available.

Comments
Martin Sarro commented May 06 '13, 4:19 a.m.
Thanx Kot!
I still get the same "Error 500: CRRED8029E: Invalid Query" even using the queryable "type/id" attribute.
I guess it could be due to the RTC version, since this same QUERY works in site Jazz.net (using RTC v4), but I can't make it works in my RTC 3.0.1.
Regards,

Your answer


Register or to post your answer.