0

I like to retrieve issue information from our sonarqube instance via the web api, namely, what issues have been resolved and what issues have been created newly.

Is it correct to use the api/issues method for this ? Does this involve all types (bug / vulnerabilities / code smells) ?

For finding newly created issues, I assume to use the parameter createdInLast (with e.g. 1d) or createdAfter - is this correct ? And in addition to this the status is OPEN (or is it enough to ask for resolved = false) ?

For finding out the resolved issues, it seems to be now api method available to filter those on a specific update date, right ?

So to figure out the resolved issues since the last call, I need to save the time the last call was made and filter the found issues myself ?

In general, I like to create a system, that runs after a new sonarqube analysis and reports all new issues and fixed issues since the last run.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
Emerson Cod
  • 1,990
  • 3
  • 21
  • 39
  • The web services were written to feed the UI. Your best bet is to play around in the UI to see what combinations of inputs get you the data you want, and _then_ translate that to web services – G. Ann - SonarSource Team Nov 21 '16 at 12:17
  • thank you for the comment - I was wondering whether this kind of task could be done better/easier etc with a simple plugin ?! To retrieve new and resolved issues since the last run should also be accessible via the plugin api, right ? – Emerson Cod Nov 21 '16 at 12:37
  • Plugins use web services. Also, you're not going to be able to get "resolved since". – G. Ann - SonarSource Team Nov 21 '16 at 14:01
  • Yes, api/issues/search is the Web Service to look. What are you trying to do? You can subscribe to email notifications to receive new issues created. – Teryk - SonarSource Nov 22 '16 at 12:30
  • I have a gamification platform. Part of that I like to award players points when solving sonarqube issues and reduce points when introducing. My idea was to run a plugin after the sonarqube analysis, that finds fixed/introduced issues and send this information to the platform – Emerson Cod Dec 01 '16 at 12:51

0 Answers0