REST | OSLC : How to get workitem types, its workflow and then the actions possible in that workflow?
![]()
I am looking for some pointers to connect the workitem type --> workitem Workflow.
1. I use the workitem services URL to get the workitem types in a project area.. eg : https://clm.admin.ws/ccm/oslc/contexts/_u4qKYqUSEeOZfPTW9a4EhA/workitems/services.xml 2.1 I am interested in looking at the states / actions available in a particular workitem type. eg: https://clm.admin.ws/ccm/oslc/types/_u4qKYqUSEeOZfPTW9a4EhA/defect 2.2. The URL to which will be : https://clm.admin.ws/ccm/oslc/workflows/_u4qKYqUSEeOZfPTW9a4EhA/actions/com.ibm.team.workitem.defectWorkflow I am looking for pointers on how to get from 2.1 to 2.2 using REST/ OSLC. I tried various ways but somehow the workitem type and links to their workflows dont seem to have a continuum. Is there a sequential step to get from workitem type to its workflow link? -or- 1 place where we can look at both workitem types, and the links to their workflows? Thanks in advance... |
Accepted answer
![]()
Hi Sunil,
At your step 2.1, check the work item "shape" rather than the type itself, namely https://clm:9443/ccm/oslc/context/_pz7gsD7rEeSp1IF8DHJaNQ/shapes/workitems/defect In the output, look for the "state" attribute and it should contain all the allowed state values <oslc:AllowedValues rdf:about="https://clm:9443/ccm/oslc/context/_pz7gsD7rEeSp1IF8DHJaNQ/shapes/workitems/defect/property/internalState/allowedValues">You also get the workflow id at the same time. Replace the "states" with "actions" in the URL and you will get all the actions in the workflow. https://clm:9443/ccm/oslc/workflows/_pz7gsD7rEeSp1IF8DHJaNQ/actions/com.ibm.team.workitem.defectWorkflow The challenge is to determine the allowed action(s) for a particular state, which does not seem possible with OSLC at this stage. https://jazz.net/forum/questions/152920/how-find-available-actions-to-change-states-in-rtc-with-oslc It is doable using Java API though. http://rsjazz.wordpress.com/2012/11/26/manipulating-work-item-states/ Sunil Kumar R selected this answer as the correct answer
Comments Donald, thank you. But using the 'shapes' URL gives me a 'HTTP 406 Not Acceptable' message with data..
<oslc_cm:status>406</oslc_cm:status>
<oslc_cm:message>OSLC Version '1.0' is not supported.</oslc_cm:message>
Could this be occuring due to missing header..? Thanks in advance.. Yes it looks like an HTTP header is missing. Here are the two HTTP headers that I use most of the time for OSLC requests.
Accept: application/rdf+xmlIf you omit the "OSLC-Core-Version" header, the default "OSLC-Core-Version: 1.0" will be assumed. Thanks a lot Donald! Yes, I am able to get the data as expected using the header, steps above.
|
One other answer
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.