GET api/project_analyses/search returns empty results

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube EE 9.9)
  • how is SonarQube deployed:Docker
  • what are you trying to achieve
  1. Ran a scan on a. branch xyz that resulted in a clean quality gate status (Passed) as seen on the Dashboard(Sonar Web GUI)
  2. Sent an api call to GET api/project_analyses/search?project=abc&category=QUALITY_GATE&branch=xyz
  3. Got the response below :
{
  "paging": {
    "pageIndex": 1,
    "pageSize": 100,
    "total": 3
  },
  "analyses": []
}
  1. Expect something like this
{
  "paging": {
    "pageIndex": 1,
    "pageSize": 100,
    "total": 3
  },
  "analyses": [
    {
      "key": "A1",
      "date": "2016-12-11T17:12:45+0100",
      "projectVersion": "1.2",
      "buildString": "1.2.0.322",
      "revision": "bfe36592eb7f9f2708b5d358b5b5f33ed535c8cf",
      "manualNewCodePeriodBaseline": true,
      "events": [
        {
          "key": "AXt91FkXy_c4CIP4ds6A",
          "category": "QUALITY_GATE",
          "name": "Success",
          "description": "some description"
        },
        {
          "key": "AXx_QFJ6Wa8wkfuJ6r5P",
          "category": "VERSION",
          "name": "6.3"
        }
      ]
    }
}
  • what have you tried so far to achieve this
    Tried changing to each of the settings below to see if it makes any difference
  • Project Setting > New Code = Use a general setting( Previous version)
  • Project Setting > New Code = Reference branch(master)

Hey there.

This guide should help you.