It's all about the answers!

Ask a question

Execute queries created in the RTC Query Editor via Reportable REST API


1
2
Michael Taylor (8865764) | asked Jun 24 '13, 3:49 p.m.
edited Nov 19 '20, 6:49 a.m. by Ralph Schoon (63.5k33646)

Can the Reportable REST API (https://<server>:<port>/ccm/rpt/repository/workitem?fields=workitem/workItem/...) be used somehow to run a query that was created in the RTC Query Editor?

   I see that this can be done using OSLC:  I want to know if this can be done using the Reportable REST API.

https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Using_Stored_Queries 

Reference old question:

                https://jazz.net/forum/questions/116945/reportable-rest-api-versus-plain-java-client-api-for-accessing-work-item-queries-and-work-item-attributes?redirect=%2Fforum%2Fquestions%2F116945%2Freportable-rest-api-versus-plain-java-client-api-for-accessing-work-item-queries-and-work-item-attributes

One answer



permanent link
Stephane Leroy (1.4k149) | answered Jun 25 '13, 2:10 p.m.
JAZZ DEVELOPER
Hi Michael,

contrarily to what I stated previously in https://jazz.net/forum/questions/116945/reportable-rest-api-versus-plain-java-client-api-for-accessing-work-item-queries-and-work-item-attributes  you could not execute a query using OSLC. 

At least not using OSLC v2.0 (i.e. with the header OSLC-Core-Version set to the 2.0 value in your GET header).
The alternate way I'm aware of is to build a query (directly in the URL - note that these are not the predefined queries you created before in the UI or the Eclipse client)  by filtering on specific attributes, etc on top of base query URL. For a reference on this: check http://open-services.net/bin/view/Main/OslcCoreSpecification#Query_Capabilities

My initial answer was based on the information returned using OSLC-Core-Version 1.0
Indeed additional data were returned. For example (this is coming from a try I had today on my 4.0.3 CLM server):
<oslc_cm:Collection xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/" oslc_cm:next="https://localhost:9443/ccm/oslc/queries?oslc_cm.pageSize=50&amp;_resultToken=_Kk8-Ut29EeKJf8PdPIFoYQ&amp;_startIndex=50" oslc_cm:totalCount="121" xmlns:dc="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/"><rtc_cm:Query rdf:resource="https://localhost:9443/ccm/resource/itemOid/com.ibm.team.workitem.query.QueryDescriptor/_5p8rsDQIEeKrSIP2Razv7w"><dc:identifier>com.ibm.team.workitem.queries.predefined.allRetrospectives</dc:identifier><dc:title>Retrospectives</dc:title><rtc_cm:projectArea rdf:resource="https://localhost:9443/ccm/oslc/projectareas/_4xR-UTQIEeKrSIP2Razv7w"/><dc:description>Find all Retrospectives.</dc:description><rtc_cm:results oslc_cm:collref="https://localhost:9443/ccm/oslc/queries/_5p8rsDQIEeKrSIP2Razv7w/rtc_cm:results"/><dc:creator rdf:resource="https://localhost:9443/jts/users/sleroy"/><dc:modified>2012-11-21T18:26:01.026Z</dc:modified><rtc_cm:modifiedBy rdf:resource="https://localhost:9443/jts/users/sleroy"/></rtc_cm:Query>....
Additional content exhibits URLs (like the https://localhost:9443/ccm/oslc/queries/_5p8rsDQIEeKrSIP2Razv7w/rtc_cm:results) that typically returned the associated work-items.

For now, I don't believe this would be a recommended practice.
Also, you shall keep in mind that loading Jazz server with too much REST calls could introduce performance problems (this was already pinpointed to you by other Jazz developers).
So  I'd strongly discourage you to investigate towards this (old) solution.

Hope this clarified things and sorry for the convenience if my guidance was (temporarily) misleading.
Note: I shall make sure the wiki topic https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Using_Stored_Queries also states things more precisely.

Regards,
Stéphane

Comments
Erwin Kunz commented Apr 23 '14, 6:48 a.m.

Hi Stéphane
Is there a way to have the query schema as datasource in RPE
I tried like all other datasources as follow:
https://server/ccm/oslc/queries?metadata=schema

Thanks
erwin


Stephane Leroy commented Apr 23 '14, 12:01 p.m.
JAZZ DEVELOPER

Hi Erwin,
I'm unsure about what you're trying to do but.... have you checked this DevWorks Q&A already ? Any helpful ?
Regards,
Stéphane


Erwin Kunz commented Apr 24 '14, 8:22 a.m.

Salut Stéphane

My goal is to create a RRDG report in RTC where the user can select a query which the report will use to query the work items.

RTC/RRC/RQM do return the schema when using ?metadata=schema what is needed in RPE. The other possibility is to have a XSD file describing the data schema.


Stephane Leroy commented Apr 24 '14, 8:58 a.m.
JAZZ DEVELOPER

Erwin,
it's my understanding the devWorks forum question I mentioned above could help wrt.  "the other possibility" (XSD file). Correct ?
Regards,
Stéphane


Erwin Kunz commented Apr 24 '14, 10:29 a.m.

Absolutely

Any idea where I can get the XSD description of ../ccm/oslc/queries

Thx
erwin


Stephane Leroy commented Apr 24 '14, 10:34 a.m.
JAZZ DEVELOPER

In this resource, Dragos points to some external tooling (XML->XSD). I've not checked it myself  but this may worths a try...

showing 5 of 6 show 1 more comments

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.