It's all about the answers!

Ask a question

How do I test for "Contains" in an "OSLC.Where" query?

Nate Decker (37814261) | asked Feb 05 '20, 10:33 a.m.
edited Feb 05 '20, 10:34 a.m.

There is a wiki article explaining the usage of the OSLC query mechanic for fetching data from RTC. This article can be found here:

In the article, it is claimed that you can search for work items where the summary contains a particular string by using the argument:
I tested this using my own project area and it doesn't work as advertised. This kind of query will only return summaries that END WITH that string. So for example, consider two hypothetical work items with summaries as follows:

1) Pursue adoption services.
2) adoption is something worth funding

The second work item will be found by the query, but the first one will not be. So rather than being a "contains" query, this seems to be a "starts with" query.

There is another example on the same page that implies you can do a "contains" search without any sort of wildcard.
Example 7 - Work Items containing 'NPE' and selecting only summary, id in the result
oslc.searchTerms "NPE"
The sample output for Example 7 includes work items that only include "NPE" as a portion of the Summary. However, in my testing this only returns exact matches.

Intuitively, if you use the '*' wildcard for the "Starts With" search, then you would logically think that you could simply put it at the beginning of the query to find work items that "End With" a particular string. However, this returns a 301 error. It would appear that asterisks at the beginning of the query string are not permitted.

How do you actually do this? That wiki page is incorrect.

One answer

permanent link
Jim Amsden (29337) | answered Feb 05 '20, 10:56 a.m.

 Sorry I can't try this right now, but OSLC Query specification indicates the * wildcard matches any property and % and _ are used for matching in string literals. Try that. 

Your answer

Register or 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.