Getting time machine tag/version information info thorugh api

java
sonarqube
web_api
(Shrewd) #1

Hello

I’m trying to get information from a sonarqube server version 5.6.7 using the sonar-ws api through java, using maven.

Current important pom info:

  <dependency>
  	<groupId>org.sonarsource.sonarqube</groupId>
  	<artifactId>sonar-ws</artifactId>
  	<version>5.6.7</version>
  </dependency>
  <dependency>
  	<groupId>org.sonarsource.sonarqube</groupId>
  	<artifactId>sonar-plugin-api</artifactId>
  	<version>5.6.7</version>
  </dependency>

I’ve made sonnar server connection, made the wsClient class to access some data, even managed to get issues for a proyect. I just need to get blocking, critics, mayor, minor, info individual count no more details needed. And as far as I know I’ve made it… example

List project = Arrays.asList(name);
List blocker = Arrays.asList(“BLOCKER”);
List info = Arrays.asList(“INFO”);
SearchWsRequest searchBlocker = new SearchWsRequest().setProjectKeys(project).setSeverities(blocker).setFacetMode(“count”);
System.out.println("BLOCKER " + wsClient.issues().search(searchBlocker).getTotal());

But I’d like to access timemachine data to know previous versions/tags information, at least I’d like to get current one version/tag.

I say tag, because the proyect is from CVS and its a tag, but I’ve seen in SonarQube web using chrome developer tools that sometimes that information comes in “version”.

Is there a way to get that information using sonar-ws library? I need a specific version? Updating sonarqube server is not a solution. I do not know if new versions of library would work.

(G Ann Campbell) #2

Hi,

First, 6.7 is the current LTS, and 7.7 is the current version. You’re going to have a hard time finding help with versions prior to that.

That said, I think you have a “Web API” link in your SQ footer. Use it to see if you have a service with the words ‘history’ and either ‘measures’ or ‘metrics’ in the name.

 
Ann