3

How to download a sonar quality profile along with description.

/profiles/export?language=java&name=xyz_profile

Gives me xml dump with repositoryKey, key, priority elements of each rule. What shud i do to get description/rule descriptiin text?

Pls help.

Arun
  • 43
  • 1
  • 4

1 Answers1

2

You should get what you want with the /api/rules web service and with help of the "profile" parameter : http://docs.codehaus.org/pages/viewpage.action?pageId=229743284

  • Thank you Freddy. Followed your instructions and was able to get the api right - this worked for me ------------- curl -X GET -v -u admin:admin "http://myserver.myhost.com:8080/api/rules?language=java&name=MyQualityProfile&format=xml" > rules_with_desc.xml ---------------------- Sorry I cant vote up yet! – Arun Jun 23 '14 at 11:44
  • 3
    Unfortunately the link is dead – Dominik Reinert May 13 '16 at 07:55
  • 1
    New link is probably this one: https://docs.sonarqube.org/pages/viewpage.action?pageId=2392166#WebService/api/rules-GetaListofRules ... however this refers to an old version of SonarQube - the latest version doesn't appear to support the /api/rules API call. – DaveG Jun 21 '18 at 13:37