1

I am using the SonarQube 6.4 API in order to search for issues. I do have two questions regarding it:

  1. Can I filter on issues related to a language?

I tried http://localhost:9000/api/issues/search?vulnerabilities=BLOCKER&language=JAVASCRIPT and I've got results for other languages in the json too.

  1. If a tester adds a comment for a specific issue, can I have it in the json results? If so, how?

enter image description here

Community
  • 1
  • 1
Samorix
  • 307
  • 4
  • 17

1 Answers1

3
  1. According to the docs for the issue search web service, here are the parameters you need to make your query work right:
    • types=VUNLERABILITY
    • severities=BLOCKER
    • languages=js

To be fair, it doesn't explicitly say that 'js' is the language key for JavaScript, but it does show it in the example. The easiest way to know what the key is for a language is do to a search for its issues via the interface and then look at the resulting URL

  1. To add comments to the response, you'll also need
    • additionalFields=comments
G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
  • Thank you so much for your response. js key is indeed the correct one. Still, I cannot display the comment i wrote. What i did is that I logged in as an administrator, commented out an issue (ok I will fix it later) and then called the web service, but the json did not have a section for the comment I wrote – Samorix Jul 11 '17 at 13:29
  • "Commented out an issue"? What does that mean in this context? – G. Ann - SonarSource Team Jul 11 '17 at 13:58
  • I mean that I added a comment to the issue like in the screenshot that I've added to my question up here – Samorix Jul 11 '17 at 14:02