Query only defect, type/name='Defect' -Invalid Query: type/name='Defect'
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'
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'
2 answers
Try https://compjazz.torolab.ibm.com:9443/jazz/rpt/repository/workitem?fields=workitem/workItem[projectArea/name='XL Compilers' and type/id='defect']/summary
Comments
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.
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.
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' )
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2
Unfortunately, use of nested things doesn't work well.
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' )
Comments
Krzysztof Kaźmierczyk
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