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

How can I run a stored query with input parameter with REST api?

Hi,
I was trying to call a stored query through REST api. I can call the query correctly using the following url:

https://server:port/ccm/oslc/queries/__pHxUOUGEeWuMokBR-rR4w/rtc_cm:results

with __pHxUOUGEeWuMokBR-rR4w that is the uuid of the query.

But what if I want to call a query that requires an input parameter? how can I add it to the url?

If I don't put the parameter I have this error:
<oslc_cm:error><oslc_cm:status>500</oslc_cm:status><oslc_cm:message>Cannot run query with unbound parameters for variable(s): 'summary21'</oslc_cm:message></oslc_cm:error>

How can I pass summary21 parameter?

Thanks,
Michele.

0 votes


Accepted answer

Permanent link
Many folks asked the same question in various ways and the answer appeared to the same - you cannot do it.
https://jazz.net/forum/questions/171754/how-to-pass-condition-value-to-a-query-prompt-through-the-url
https://jazz.net/forum/questions/177625/can-we-bind-parameters-to-rtc-query
https://jazz.net/forum/questions/146701/how-to-use-parametrized-queries-in-plain-java-api

Note that the ability to use stored queries is considered as "preliminary support", and may not get any further enhancement on top of what is described in the Wiki. Also, it may not be obvious - this feature requires OSLC 1.0. In other words, it may have been deprecated already given that we usually work with OSLC 2.0 now.
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Using_Stored_Queries
Michele Pegoraro selected this answer as the correct answer

0 votes

Comments

Thank you.


2 other answers

Permanent link
Hi Michele, 

I am not sure what the "summary21" is, but have you tried OSLC query parameters?
http://open-services.net/bin/view/Main/OSLCCoreSpecQuery#Query_Parameters

0 votes


Permanent link
Hi Michele Pegoraro

Were you able to pass the parameters?Because I am also getting the same issues.

0 votes

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
× 12,025
× 516
× 480
× 201

Question asked: Mar 22 '16, 11:39 a.m.

Question was seen: 6,214 times

Last updated: Nov 01 '16, 1:28 p.m.

Confirmation Cancel Confirm