Search code examples
hp-quality-centeralm

HP ALM query by name with spaces


I am trying to use HP ALM 11's REST API. So far I have been able to query stuff fine. Now I have hit a case where the name of the entity (a test folder) is with spaces: "WebView - New Thin UI"

{name['WebView - New Thin UI']}

If I specify the query like {name['WebView*']} it returns a bunch of test folders among which is also the one mentioned above.

However, if I use the full name including the spaces (The string gets escaped and spaces converted to +. I can see GET /qcbin/rest/domains/XXX/projects/XXX/test-folders?query=%7Bname%5B%27WebView+-+New+Thin+UI%27%5D%7D&page-size=max&start-index=1 HTTP/1.1 in the logs) I get no results (empty set, not an error).

I do not see how else I should specify the query criterion so that it would work.


Solution

  • Use double quotes instead of single quotes.

    Following query works fine with my instance and returns single record.

    http://hp.gaurav.com:8080/qcbin/rest/domains/DEFAULT/projects/TestProject/defects?query={name[="Sample query test"]}