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. |
Accepted answer
![]()
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
|
2 other answers
![]()
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
|
![]() |
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.