Search code examples
pythongerritrest

How to fetch list of all change number based on project and branch specified using rest API?


I am trying to fetch list of gerrit number using REST API in Python based on project and branch specification.

https://hostname/#/q/project:<project-name>+branch:<branch-name>+status:merged

When I run this on Gerrit on browser, I am able to see list of Gerrit with owner, project, branch, status etc. on screen. When same when I pass on REST API with get method I am not able to get the list of gerrit, instead I am getting gerrit browser HTML data of the page.

I refer REST API documentation but could not get the list of change based on project and branch filter.

How to fetch list of Gerrit change number based on filter (project, branch and other)?


Solution

  • Thanks Marcelo, Yes it is working with Query string "changes/?q=project:PROJECT+AND+branch:BRANCH+AND+status:STATUS" ,