How to use parametrized queries in plain java API
Hello,
I created a personal query, that, among other search parameters, has Summary=<provide value at query run> (so the value is not preset, but dynamic. Assuming I have an IQueryDescriptor that corresponds to this query, how would I go about providing the parameter to run this query? |
3 answers
What I actually did is create a query without the parametrized attribute, cache the results in my program, and perform the search based on the attribute inside the java program.
This is actually ok, as it saves me from running the query over and over again with different parameter values. |
I hate it when u make me work to answer a question!!.. but I learn something
in my case the query is find the workitem(s) with the old_wi_id field with value=?, in this case the data was '123456'
https://jazz.intranet.xx.com/ccm/resource/itemOid/com.ibm.team.workitem.query.QueryDescriptor/_EG5I8pzfEeOsZYheQqjNwg?_mediaType=text/html&jsonParameterValues=%7B%22com.xx.workitem.attribute.old_wi_id3%22%3A%7B%22attributeId%22%3A%22com.xx.workitem.attribute.old_wi_id%22%2C%22operator%22%3A%22is%22%2C%22values%22%3A%5B123456%5D%7D%7D&nocache=1395840685618
|
I know that this is not good work around, but you can run unparametrized query and iterate over results to fetch work items matching your params.
|
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.
Comments
I would check Ralph's blog for dynamic query construction. I haven't done this myself.
Neither have I. Unfortunately. I would be interested in how it works too.
I have done construction of queries, but I am not sure how parameters are represented and filled.
Thank you, you're right that's not a good workaround.
did u see the syntax below?