OSLC REST API: Usage of wildcard in oslc.where
I am accessing ClearQuest using OSLC REST API and VB.
I’ve been trying to query the database using a wildcard (“*”) in the ‘oslc.where’ clause, unfortunately with no success so far.
Queries using ‘oslc.where’ without wildcards work without problem.
The scenario: I am querying for a string field called ‘Responsible_List’ containing a space separated list of permitted users in the current task, e.g. “user0 user1 user2”.
I need to determine whether the user of the current REST API session (e.g. “user1”) is part of that list.
That’s what I have tried:
oslc.where=cq:Responsible_List=""*user1*""
The query does not return an error, but a no match (i.e. total count = 0)
I’ve already read through http://open-services.net/bin/view/Main/OSLCCoreSpecQuery, but didn’t come across a matching example.
Can anybody please provide some help?
Peter
2 answers
this wiki gives you some use case sample of wildcards for ClearQuest in OSLC: https://jazz.net/wiki/bin/view/Main/CqOslcV2
Check specifically the section starting by "The
*
character is a wildcard that expands to match all properties...".
Regards,
Stéphane
Comments
Hi Stéphane,
The link you posted is another resource I already had checked out.
Unfortunately it does not give an example for my scenario:
I do not need to query all properties of a record using the '' as wildcard, but instead filter for a field matching a substring (in VB you can use the 'instr' function to accomplish this task).
Again my example:
field value: cq:Responsible_List="user0 user1 user2"
substring to be matched: "user1"
oslc.where=cq:Responsible_List=""user1*""Regards,
Peter
Hello Peter,
Did you have any luck getting a wildcard string search working? I am struggling with this as well.
Thanks
Mike
Hello Mike,
unfortunately not. I managed to change my code so that I do not need to query for substrings anymore.
Still I would be interested in a solution.
Regards,
Peter
Thanks for getting back to me, will let you know if I find anything.
Mike
ClearQuest OSLC CM 2.0 implementation does not fully oslc.Where - wildcard (*) support on identifiers is a missing feature.
Please see the OSLC Implementation report, and please submit a RFE against ClearQuest if this is needed.
Thanks
- Yuhong Yin
Development Manager, ClearCase/ClearQuest Jazz Integrations
Email: yyin@us.ibm.com