GetVersionCollection - repeating check in comments

Oct 22, 2014 at 4:59 PM
Hey!

I trying to use GetVersionCollection to return all the check in comments for a specific document in the shared documents library.
getVersions2:function(){
console.log('getting versions');
 $().SPServices({
        operation: "GetVersionCollection",
        async: false,                        
        strlistID: "Shared Documents",
        strlistItemID: 12,
        strFieldName: "_CheckinComment",
        completefunc: function (xData, Status) {
            $(xData.responseXML).find("Version").each(function() {
                console.log($(this).attr("_CheckinComment"));
            });             
        }
 });    


},
This does work but I get the last comment repeated 5 times (there are 5 versions of the document).

If I change the column to _UIVersionString then I get the correct version numbers (0.5, 0.4, 0.3) etc.

I know that I will need to make a couple of passes to collate the info that I need to present on the page but I cannot seem to be able to get the correct comments to come through.

Any help will be gratefully received.

Cheers,

IntranetLou