It's all about the answers!

Ask a question

Code Review Findings, Approvals using Java APIs

vinitha dsouza (14718111) | asked Nov 16 '17, 2:19 a.m.
retagged Jan 25 '19, 10:16 a.m. by Ken Tessier (84117)

Hello Team,

We want to get overview of how many code review findings raised, how many are resolved, is there any pending approvals,which stream it is delivered,for snapshot.

Which then will be executed by Release engineer to make sure Code Review Coverage for Snapshot.

Note: We are using Code Review Tool for Code Review.

Could you please let us know how this can be achieved using Java Client Libraries.


Accepted answer

permanent link
David Lafreniere (4.8k7) | answered Jan 11 '19, 3:39 p.m.
edited Jan 11 '19, 3:41 p.m.
The easiest way to get information on Code Review (the number of issues and their states) run the 'export code-review' CLI command. This can generate a full XML or JSON report which you can then parse as you wish.


To write output to a JSON file for code review work items that result from a work item query, create a work item query that displays the work items that you want the code review data for and use the work item query ID in the export code-review command. For example, in work item query https://example:9443/ccm/web/projects/, the query ID is _UU6RMMqrEeWW1pjuq1MlnQ.

Use the query ID in the command to export the work items to the file. For example:

scm export code-review -r kg --json _UU6RMMqrEeWW1pjuq1MlnQ queryResult.json

The output is written to queryResult.json.

Otherwise, in terms of Java API, see ICodeReviewService

Ralph Schoon selected this answer as the correct answer

Your answer

Register or to post your answer.