How to get the history of a work Item by oslc?
Accepted answer
A call to the reportable REST API such as this will give you the full history of a workitem (change the id=7 parameter to the id of the wi you need):
https://server:9443/ccm/rpt/repository/workitem?size=10&fields=workitem/workItem[id=7]/(itemHistory/*)
If you must use OSLC, you can append a state identifier to the Location URI you are calling to retrieve a particular version of a wi. Its likely you use a URI such as this to retrieve the details of a wi:
https://server:9443/ccm/resource/itemOid/com.ibm.team.workitem.WorkItem/itemId
Changing it to this will return the wi details as it existed in that revision:
https://server:9443/ccm/resource/itemOid/com.ibm.team.workitem.WorkItem/itemId/stateId
I don't have an easy suggestion on how to retrieve the stateId's other than using the reportable REST API:
https://server:9443/ccm/rpt/repository/workitem?size=10&fields=workitem/workItem[id=7]/(itemHistory/stateId)
https://server:9443/ccm/rpt/repository/workitem?size=10&fields=workitem/workItem[id=7]/(itemHistory/*)
If you must use OSLC, you can append a state identifier to the Location URI you are calling to retrieve a particular version of a wi. Its likely you use a URI such as this to retrieve the details of a wi:
https://server:9443/ccm/resource/itemOid/com.ibm.team.workitem.WorkItem/itemId
Changing it to this will return the wi details as it existed in that revision:
https://server:9443/ccm/resource/itemOid/com.ibm.team.workitem.WorkItem/itemId/stateId
I don't have an easy suggestion on how to retrieve the stateId's other than using the reportable REST API:
https://server:9443/ccm/rpt/repository/workitem?size=10&fields=workitem/workItem[id=7]/(itemHistory/stateId)
Comments
Buzz Moschetti
Dec 07 '12, 7:30 p.m.Someone from Jazz Developers should have responded to this. It's a basic question.