How do I query workitems by state via OSLC ?
![](http://jazz.net/_images/myphoto/3ffd0c8f132820bc95b529c04bc2624b.jpg)
Appreciate if someone can provide samples of query using OSLC (V1 spec) for:
a) state is "New"
b) severity is "High"
c) ownedBy "hoge@dummy.orz"
Suppose simple query URL is as follows:
https://dummy.orz:9443/ccm/oslc/contexts/_0_5h4C85EeCPsafujiko/workitems
As for a)
https://dummy.orz:9443/ccm/oslc/contexts/_0_5h4C85EeCPsafujiko/workitems?oslc_cm:query=rtc_cm:state="New"
does not work.
a) state is "New"
b) severity is "High"
c) ownedBy "hoge@dummy.orz"
Suppose simple query URL is as follows:
https://dummy.orz:9443/ccm/oslc/contexts/_0_5h4C85EeCPsafujiko/workitems
As for a)
https://dummy.orz:9443/ccm/oslc/contexts/_0_5h4C85EeCPsafujiko/workitems?oslc_cm:query=rtc_cm:state="New"
does not work.
2 answers
![](http://jazz.net/_images/myphoto/3ffd0c8f132820bc95b529c04bc2624b.jpg)
It is helpful to look at the content of a work item to see what all the attributes qualified names are, and you can see how the values are represented in this case, I think you need to use the literal string values.
I was able to search based on these examples for a Task with the Defect Workflow
Last piece I just found if you want to chain them together use the CM Query syntax ' and '
http://open-services.net/bin/view/Main/CmQuerySyntaxV1
-Sean
I was able to search based on these examples for a Task with the Defect Workflow
?oslc_cm.query=rtc_cm%3Astate%3D%221%22
?oslc_cm.query=oslc_cm%3Aseverity%3D%22severity.literal.l3%22
?oslc_cm.query=rtc_cm%3AownedBy%3D%22_9NFgtYVOEd-rt83OFre0Xg%22
Last piece I just found if you want to chain them together use the CM Query syntax ' and '
http://open-services.net/bin/view/Main/CmQuerySyntaxV1
?oslc_cm.query=rtc_cm%3Astate%3D%221%22%20and%20oslc_cm%3Aseverity%3D%22severity.literal.l3%22%20and%20rtc_cm%3AownedBy%3D%22_9NFgtYVOEd-rt83OFre0Xg%22
-Sean
![](http://jazz.net/_images/myphoto/3ffd0c8f132820bc95b529c04bc2624b.jpg)
Thanks for the info. After I checked RTC SDK V2, I realized I can use
special variables, like "{currentUser}" for user and "{new}", "{closed}" for state. This simplifies query statement.
But I believe that most of users are familiar with just literals in stead of hidden internal id.
special variables, like "{currentUser}" for user and "{new}", "{closed}" for state. This simplifies query statement.
But I believe that most of users are familiar with just literals in stead of hidden internal id.