It's all about the answers!

Ask a question

How do I query workitems by state via OSLC ?


Takehiko Amano (1.3k3741) | asked May 19 '11, 5:04 a.m.
JAZZ DEVELOPER
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.

2 answers



permanent link
Sean G Wilbur (87222421) | answered May 19 '11, 1:43 p.m.
JAZZ DEVELOPER
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

?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

permanent link
Takehiko Amano (1.3k3741) | answered May 19 '11, 11:04 p.m.
JAZZ DEVELOPER
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.

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.