It's all about the answers!

Ask a question

How to use oslc.query in the RTC RESTful simply query interface

Dave Sinclair (21179) | asked Mar 06 '15, 4:28 a.m.
I am trying to write some Perl code to use the RESTful interface on RTC to access workitems.  I am able to get the simpl_query_services URI as described in and   When I use the basic URI, eg

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"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=""/>

so how should I construct a query to find all these items - i tried"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

permanent link
Aaron Cabrera (451418) | answered Mar 06 '15, 11:01 a.m.
edited Mar 06 '15, 11:04 a.m.

I'm new to oslc but here is an example that works for me


permanent link
Aaron Cabrera (451418) | answered Mar 06 '15, 2:00 p.m.
edited Mar 06 '15, 2:26 p.m.

In our environment - we can use the URI for Work Item Types

It will retrieve the xml of all the work item types in the project area

This snippet is for work item type Story

  Work Item Type Story

Notice dcterms:identifier =

Use in the oslc.where clause

List of Stories""
List of Stories with Attributes""&,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

permanent link
Harald Freyer (11) | answered Nov 03 '15, 8:08 a.m.
In other articles (e.g. I have found the hint that workItemType is something like a "complex" attribute and one needs to use on its "id". For me, this olsc.where expression worked (I replaced my type with your "build" type)
(decoded: oslc.where=workItemType/id="build")

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.