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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

42 views 0 4
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