Using the REST API to get the history for a file
Peter Weller (39●3●7●9)
| asked May 15 '13, 1:52 a.m.
edited May 20 '13, 3:52 p.m. by Millard Ellingsworth (2.5k●1●24●31)
Hi,
I am wondering whether your REST API (or even the Java API) is able to expose the history for a file? I've looked at this reports API, but it looks like it only describes the comment and the owner. If there's no API, is lscm compare the way forward?
I spotted another question which was asking exactly the same thing, but it never got an answer. Rather than reviving an old question, I thought I'd try again.
Thanks,
Peter
|
Accepted answer
There are scm rest calls for this but they aren't considered public API. They're subject to change so you'll have to be on top of new releases and test your rest calls.
For item history: https://example.com:9443/ccm/service/com.ibm.team.scm.common.internal.rest.IScmRestService/history?workspaceItemId={workspace id}&componentItemId={component id}&oid=com.ibm.team.filesystem.FileItem/{item id} If you omit the item id, it will retrieve the component history. Peter Weller selected this answer as the correct answer
Comments Can you please help me with the URL framing..
I think Nayeem also asked this as a question. Right..I did..This might be answer to my question if I am able to frame the URL
|
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.
Comments
server/ccm/service/com.ibm.team.workitem.common.internal.rest.IWorkItemRestService/workItemDTO2?id={workitem id here}&includeAttributes=false&includeLinks=false&includeApprovals=false&includeHistory=true
Good answer Arek. Thanks :)
Hi,
Arkadiusz's answer addresses work-item history whereas AFAIK Peter's question was related to SCM part.
For the work-item history (little out of topic here), you could also use: https://localhost:9443/ccm/rpt/repository/workitem?fields=workitem/workItem[id=1]/(itemHistory/*)
Regards,
Stéphane
As Stéphane mentioned, I'm after the changes for a given file, not for the workitem.
Yeah you got it right, I'm after the SCM part/the history for a given file.