cancel
Showing results for 
Search instead for 
Did you mean: 

Use the REST API to obtain reviews from a particular repository

SOLVED
Highlighted
New Contributor

Use the REST API to obtain reviews from a particular repository

Is there a way to obtain all the reviews from a particular SVN repository through the use of the json REST API?

 

I'm hoping to automate some reports.

 

Thanks,

Gerardo Cobo

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Contributor

Re: Use the REST API to obtain reviews from a particular repository

I figured it out, in case anyone is interested.

 

The command I was looking for is "findReviewsByScmChangelist".

 

From the documentation on the ReviewService:

findReviewsByScmChangelist

Searches for reviews that contain changelists matching the specified criteria, returning general review info if found.

  • scmConnectionParameters - Array of String. Required. - List of connection parameters used to find the SCM configuration, to which the changelist belongs. Must be in the same order as defined in the SCM configuration of the GUI client or the Admin configuration in the web application.
  • scmToken - A constant of ScmToken type. Required. - Defines a SCM system to which the changelist belongs.
  • scmId - String. Required. - Changelist name or ID in a SCM system.
  • reviewIdRegex - String. Optional. - Regular expression matching the needed changelists comment.
  • reviewPhase - String. Optional. - Phase of the needed reviews.

 

It wasn't entirely clear to me at first, but for my case, the parameters needed the following information on a SVN repository:

  • scmConnectionParameters - A list with the only the SVN URL.
  • scmToken - "SUBVERSION".
  • scmId - The commit number.

For example:

[
{
"command": "ReviewService.findReviewsByScmChangelist",
"args": {
"scmConnectionParameters": [
"svn.example.com/svn/repository/"
],
"scmToken": "SUBVERSION",
"scmId": "1"
}
}
]

 Would give us the reviews for commit 1 on the "svn.example.com/svn/repository/" repository.

View solution in original post

2 REPLIES 2
Highlighted
New Contributor

Re: Use the REST API to obtain reviews from a particular repository

I figured it out, in case anyone is interested.

 

The command I was looking for is "findReviewsByScmChangelist".

 

From the documentation on the ReviewService:

findReviewsByScmChangelist

Searches for reviews that contain changelists matching the specified criteria, returning general review info if found.

  • scmConnectionParameters - Array of String. Required. - List of connection parameters used to find the SCM configuration, to which the changelist belongs. Must be in the same order as defined in the SCM configuration of the GUI client or the Admin configuration in the web application.
  • scmToken - A constant of ScmToken type. Required. - Defines a SCM system to which the changelist belongs.
  • scmId - String. Required. - Changelist name or ID in a SCM system.
  • reviewIdRegex - String. Optional. - Regular expression matching the needed changelists comment.
  • reviewPhase - String. Optional. - Phase of the needed reviews.

 

It wasn't entirely clear to me at first, but for my case, the parameters needed the following information on a SVN repository:

  • scmConnectionParameters - A list with the only the SVN URL.
  • scmToken - "SUBVERSION".
  • scmId - The commit number.

For example:

[
{
"command": "ReviewService.findReviewsByScmChangelist",
"args": {
"scmConnectionParameters": [
"svn.example.com/svn/repository/"
],
"scmToken": "SUBVERSION",
"scmId": "1"
}
}
]

 Would give us the reviews for commit 1 on the "svn.example.com/svn/repository/" repository.

View solution in original post

Highlighted
Occasional Visitor

Re: Use the REST API to obtain reviews from a particular repository

Thank You!

New Here?
Join us and watch the welcome video:
Announcements
Building with the Collaborator API

Help Documenation
The Collaborator API is a JSON-RPC API that lets you integrate with Collaborator 9.0 and above. For more information about how the API works, check out the API description here:


Sample Plugins
For an example of an add-in that uses the API, take a look at the Microsoft Word Add-in for Collaborator:


We list all the great plugins our network has already built on this page on the SmartBear website.