I am working on a contextual velocity report, so I receive a $documentList as input.
I want to build a table with the following columns
DocumentKey, DocumentName, ReviewID, ReviewName, DocumentVersionInReview, NumberOfComments, Comments
So I parse the documentList and for each doc I get all versions
With each version, I get all the revisions, using the getRevisionsForItemId(version.document.id)
With each revision, I get all the items in it, using getRevisionItems()
Then I want to get all comments for each item in the revisionItemList.
Example
VSS2x-VBSSVP-788 in V2 has been part of Review REV-620 and 0 comment on it
VSS2x-VBSSVP-788 in V4 has been part of Review REV-646 and 44 comments on it
VSS2x-VBSSVP-788 in V8 has been part of Review REV-667 and 1 comment on it
With the function $commentSource.getRevisionItemCommentCount(revItemId) I am able to distinguish the 3 lines with the revItemId.
Then I use the $commentSource.getCommentsForItem(revItemId) with the same revItemId and I receive [] for the first and for the second line of example and all the 45 comments for the third line.
I need the appropriate comments for the appropriate lines.
I have attached the complete code I am using. Search for the # ERROR # and you will then see the line of code that does not give me what I want
I have found a script on the github which almost does What I need but the last step I want is not there. Community-Reports/Review Center Reports/Review Details Per Item Context Based at master · jamasoftware-ps/Community-Reports (github.com)
------------------------------
Bertrand Lechevalier
------------------------------