Can you list Gerrit reviews from a Jirra issue through the Jira REST API

Hello,

We have the "Gerrit Code Review for Jira" plugin installed and configured. The plugin is working, I can see the related Gerrit reviews listed in the Jirra issue through the UI. 

Is there a way to see the related Gerrit reviews through the JIRA REST api?

example: curl -u admin:admin http://localhost:8090/jira/rest/api/2/issue/MKY-1

Eric

1 answer

1 accepted

You can't get them via REST from JIRA - the Gerrit reviews are rendered as a web panel which does not use REST to get the data.

You have several options, depending on access restrictions and how proficient you are in coding:

  1. Call directly the Gerrit REST API, making the same query as the one executed by the Gerrit plugin for JIRA. The plugin is open source, so you can take a look at the code.
  2. Contribute a REST endpoint to the plugin code
  3. If you use Script Runner, you can write a script to invoke the Gerrit plugin manager which returns this data (com.meetme.plugins.jira.gerrit.data.IssueReviewsManager). However, this service is not currently public, so you'll need to contribute a change to its source code to make it public. This script can then be exposed as REST in Script Runner.

If you have sufficient access, the easiest way will be option 1.

 

 

 

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

423 views 1 14
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot