How to use oslc.query in the RTC RESTful simply query interface
https://myjazzserver.com:9443/jazz/oslc/contexts/_8IloQGRKEeGMeeKcLm-Fsg/workitems
then all seems to work well and I get a collection of workitems returned (in fact all the workitems in the Project). However, I have not been able to work out how to do a 'where' query to select a subset of these workitems, eg
https://myjazzserver.com:9443/jazz/oslc/contexts/_8IloQGRKEeGMeeKcLm-Fsg/workitems?oslc.where=dc:identifier="1832"
again returns all the workitems in the project. In fact, whatever I put in the where clause seems to have absolutely no effect. Can anyone say what the correct syntax is for these types of queries? I want to be able to do queries based on id and also on workitem type, which seems to be a more complex resource type. For instance we have a workitem type called 'build' in our project, and i would like to be able to find all the workitems of that type. The type is indicated in the workitem description by elements such as
<dc:type rdf:resource="https://jazz201.hursley.ibm.com:9443/jazz/oslc/types/_8IloQGRKEeGMeeKcLm-Fsg/build"/>
so how should I construct a query to find all these items - i tried
https://myjazzserver.com:9443/jazz/oslc/contexts/_8IloQGRKEeGMeeKcLm-Fsg/workitems?oslc.where=dc:type="build"
but this does not work. How does the oslc_prefix parameter play in all of this?
Any help or examples greatly appreciated.
3 answers
In our environment - we can use the URI for Work Item Types
https://myjazzserver.com:9443/jazz/oslc/types/_8IloQGRKEeGMeeKcLm-Fsg/
It will retrieve the xml of all the work item types in the project area
This snippet is for work item type Story
Notice dcterms:identifier = com.ibm.team.apt.workItemType.story
Use com.ibm.team.apt.workItemType.story in the oslc.where clause
List of Stories
https://myjazzserver.com:9443/jazz/oslc/contexts/_8IloQGRKEeGMeeKcLm-Fsg/workitems?oslc.where=rtc_cm:type="com.ibm.team.apt.workItemType.story"
List of Stories with Attributes
https://myjazzserver.com:9443/jazz/oslc/contexts/_8IloQGRKEeGMeeKcLm-Fsg/workitems?oslc.where=rtc_cm:type="com.ibm.team.apt.workItemType.story"&oslc.select=dcterms:type,dcterms:identifier,dcterms:type,rtc_cm:type
You can also get the Work Item Type ID (dcterms:identifier) by going into :
Manage This Project Area -> Work Items -> Types and Attributes: use the ID associated with the Work Item Type
oslc.where=workItemType%2Fid%3D%22build%22
(decoded: oslc.where=workItemType/id="build")