It's all about the answers!

Ask a question

How to get the history of a work Item by oslc?


1
1
Melanie Finke (7721520) | asked Sep 25 '12, 9:10 a.m.
Hi,

I try to get the complete history of a work Item by oslc.
There are dcterms:modified and rtc_cm:modifiedBy to get the information when and who modified the work Item.
Is there a possibility to get the complete history like displayed in the history tab?

Best regards

Comments
Buzz Moschetti commented Dec 07 '12, 7:30 p.m.

Someone from Jazz Developers should have responded to this.   It's a basic question.

Accepted answer


permanent link
Brian Fleming (1.6k11928) | answered Dec 10 '12, 11:12 a.m.
edited Dec 10 '12, 11:13 a.m.
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)

Melanie Finke selected this answer as the correct answer

Your answer


Register or to post your answer.