It's all about the answers!

Ask a question

Query only defect, type/name='Defect' -Invalid Query: type/name='Defect'


Roy Bae (123) | asked Mar 22 '13, 6:29 p.m.
retagged Mar 27 '13, 9:12 p.m. by Brian Fleming (1.6k11928)
I'd like to query only workitem which type is 'defect'. When  'and type/name='Defect' is appended,  it doesn't work. What am I missing?

Working:
https://compjazz.torolab.ibm.com:9443/jazz/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='XL Compilers']/summary

NOT working: appended (and type/name='Defect)
https://compjazz.torolab.ibm.com:9443/jazz/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='XL Compilers' and type/name='Defect' ]/summary

Error 500: CRRED8029E: Invalid Query: type/name='Defect'


Comments
Krzysztof Kaźmierczyk commented Mar 25 '13, 5:28 a.m.

I had the same issue in the past. The root cause is that 'type' is reserved keyword. Unfortunately I don't know the work around :-(

Best regards,
Krzysztof Kazmierczyk

2 answers



permanent link
Roy Bae (123) | answered Mar 28 '13, 10:39 a.m.
As a work around, I tried to achieve the same using OSLC as follows:
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2

Unfortunately, use of nested things doesn't work well.

The complete path is:

https://compjazz.torolab.ibm.com:9443/jazz/oslc/contexts/_NmIe8D8qEd6jzOcwVhPAgw/workitems?oslc_cm.query=rtc_cm:ownedBy=%22_IDAwAEb-Ed6ZILcqUy1ErQ%22&oslc_cm.properties=rtc_cm:ownedBy{rtc_cm:userId}

above works

https://compjazz.torolab.ibm.com:9443/jazz/oslc/contexts/_NmIe8D8qEd6jzOcwVhPAgw/workitems?oslc_cm.query=rtc_cm:ownedBy{rtc_cm:userId=%22rzurob@ca.ibm.com%22}&oslc_cm.properties=rtc_cm:ownedBy{rtc_cm:userId}

above doesn't work ( I added '{rtc_cm:userId="rzurob@ca.ibm.com"}' after 'rtc_cm:ownedBy' )

permanent link
Brian Fleming (1.6k11928) | answered Mar 27 '13, 9:09 p.m.
Try https://compjazz.torolab.ibm.com:9443/jazz/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='XL Compilers' and type/id='defect']/summary

Comments
Roy Bae commented Mar 28 '13, 10:35 a.m.

Thanks for your comment, but it doesn't work. It returns:

Error 500: CRRED8029E: Invalid Query: type/id='defect'



For other users, by the way, the API we are referring to is as follows

https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI?errno=2

...
com.ibm.team.workitem.WorkItemType

This element represents the type of a work item. Work item types are process-dependent.

Properties:

  • id (type: xs:string). The id of the type (e.g. "com.ibm.team.workitem.defect"), unique in a repository.
  • name (type: xs:string). The name of the type (e.g. "Defect"). Not necessarily unique.
...


Brian Fleming commented Mar 28 '13, 10:50 a.m.

What version of RTC are you using?  The query in my answer works on 4.0, but  I haven't tried it in earlier versions. 

Your answer


Register or 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.