Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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

2

1 vote



One answer

Permanent link
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

0 votes

Comments

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

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

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.

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

Absolutely

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

Thx
erwin

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Jun 24 '13, 3:49 p.m.

Question was seen: 9,703 times

Last updated: Nov 19 '20, 6:49 a.m.

Confirmation Cancel Confirm