It's all about the answers!

Ask a question

Want to get full change history of source code (without limitation of 100)


Oguzhan Yigit (313) | asked Nov 07 '13, 10:10 a.m.
edited Nov 07 '13, 10:11 a.m.
Hello,
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


permanent link
Remy Suen (42624) | answered Nov 07 '13, 10:20 a.m.
Hi Oguzhan, I looked at your URL and I think you have two things wrong.
versionableItemNamespace=com.ibm.team.filesystem (not com.ibm.team.scm)
versionableItemType=FileItem (not com.ibm.team.filesystem.FileItem)
Does that work?
Oguzhan Yigit selected this answer as the correct answer

Comments
Oguzhan Yigit commented Nov 07 '13, 10:26 a.m. | edited Nov 07 '13, 10:27 a.m.

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


Remy Suen commented Nov 07 '13, 10:29 a.m.

You didn't change your versionableItemNamespace yet. It needs to be com.ibm.team.filesystem. You are still using com.ibm.team.scm.


Oguzhan Yigit commented Nov 07 '13, 10:36 a.m. | edited Nov 07 '13, 10:38 a.m.

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


Remy Suen commented Nov 07 '13, 10:56 a.m.

Oguzhan Yigit commented Nov 08 '13, 8:33 a.m.

Can't I call the service that the Eclipse Client calls to show the history? Do you have further information on this?


sam detweiler commented Nov 08 '13, 8:41 a.m.

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.


Remy Suen commented Nov 08 '13, 8:46 a.m.

What Sam said...

showing 5 of 7 show 2 more comments

Your answer


Register or to post your answer.