REST API to get the date of the last project analysis?

How to get the time of the last analysis of the project (the one that you see on the control panel) using the REST API for SonarQube?

I work with SonarQube 4.5.6, but if it is available only in later versions, I will still be interested in how this is done.

+7
sonarqube sonarqube-api
source share
2 answers

You can use the resource API: https://nemo.sonarqube.org/api/resources/index?metrics=date&format=json and see the "date" field to get the latest analysis time.

+3
source share

[EDIT] API since SonarQube v6.3: api / project_analyses / search

[EDIT] Corresponding API for SonarQube LTS v5.6.x: api / projects? versions = true

And since you mention later versions since SonarQube 5.2:

api/ce/component : get pending tasks, execution tasks and the last completed task of this component (usually a project) ( documentation )

PS: api/components/show can be used to get the component identifier from the project keyword

PS2: here is an example of real work in the public project SonarQube . First, get the component ID , then request the component"submittedAt": "2016-03-07T06:04:31+0100" (a slight difference with the dashboard value due to processing time on the side of the scanner)

+9
source share

All Articles