Want to get full change history of source code (without limitation of 100)
I try to get the full change history of a source code file. We use RTC 4.0.1.
In the beginning I used the service that the RTC Webclient uses (IScmRestService#history) but it limits every result to 100 changes.
Later I found out, that there is a IScmRestService2#historyPlus service, which I can pass a parameter for the number of results, but you guessed it.... it's also limited to 100. I can pass parameters under 100 and they are accepted, but the maximum is 100.
So I asked some developers and they told me that the service I try to call is exclusively for the Webclient, so I'm struggling now with the service for the clients. The method is called IScmRichClientRestService#getItemHistory.
In the source code IScmRichClientRestService.java I see that I have to give these parameters:
-contextItemNamespace;
-contextItemType
-contextItemId
-componentItemId
-versionableItemNamespace
-versionableItemType
-versionableItemId
I try to call it like this:
https://xxxx.com:9445/jazz/service/com.ibm.team.scm.common.rest.IScmRichClientRestService/itemHistory?contextItemId=_7HsRsTvYEeOkSJ3RlXQrBQ&versionableItemType=com.ibm.team.filesystem.FileItem&versionableItemId=_-xoDMDuFEeCneON3DJueNg&componentItemId=_hGuj0DNyEeCeJNSDhXtNkg&contextItemNamespace=com.ibm.team.scm&versionableItemNamespace=com.ibm.team.scm&contextItemType=Workspace
I also tried to change the method to getitemHistory or just history, but it didn't change sth., I always get 500 Internal Server Error response. If I use POST instead of GET it returns 400 - Bad Request
Later I saw this defect https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=214396
and it says that even this service limits it to 100, I couldn't test it so far, because I couldn't manage to pass the parameters correctly.
But RTC Eclipse is able to show the full change history. Are there any information how I can call the method that the RTC Eclipse Client calls?
Thanks in Advance!
Accepted answer
versionableItemNamespace=com.ibm.team.filesystem (not com.ibm.team.scm)
versionableItemType=FileItem (not com.ibm.team.filesystem.FileItem)Does that work?
Comments
Unfortunately not,
my request now:
https://xxxx.com:9445/jazz/service/com.ibm.team.scm.common.rest.IScmRichClientRestService/itemHistory?contextItemId=7HsRsTvYEeOkSJ3RlXQrBQ&versionableItemType=FileItem&versionableItemId=-xoDMDuFEeCneON3DJueNg&componentItemId=_hGuj0DNyEeCeJNSDhXtNkg&contextItemNamespace=com.ibm.team.scm&versionableItemNamespace=com.ibm.team.scm&contextItemType=Workspace
You didn't change your versionableItemNamespace yet. It needs to be com.ibm.team.filesystem. You are still using com.ibm.team.scm.
Ahhh now it works!
But after I passed the parameter "desiredPagesize=200" it still only shows the last 100.
My Request:
https://xxxx.com:9445/jazz/service/com.ibm.team.scm.common.rest.IScmRichClientRestService/itemHistory?contextItemId=7HsRsTvYEeOkSJ3RlXQrBQ&versionableItemType=FileItem&versionableItemId=-xp4YDuFEeCneON3DJueNg&componentItemId=_hGuj0DNyEeCeJNSDhXtNkg&contextItemNamespace=com.ibm.team.scm&versionableItemNamespace=com.ibm.team.filesystem&contextItemType=Workspace&desiredPageSize=200
That's a bug and we fixed it in 4.0.3.
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/214396
Can't I call the service that the Eclipse Client calls to show the history? Do you have further information on this?
I think the rest api call DOES call the same service in the server.. the BUG is that the parameter for
response size is not applied to the actual data request.
What Sam said...