I have a SONARQUBE container installed in the docker-desktop
I was using the Community Edition v10.7 (96327) version, but it became NOLONGER ACTIVE
This time, I run a new SONARQUBE container, and the version is CommunityBuild v25.3.0.104237.
I can’t get the results from the API response.
In v10.7
curl -X GET "http://sonarqube:9000/api/measures/component_tree?additionalFields=metrics&ps=500&asc=true&s=qualifier%2Cname&p=1&component=gradle_project%3Asrc&metricKeys=comment_lines&strategy=all" \ -H "Accept: application/json" | jq
{
"key": "gradle_project:src/main/java/seable.java",
"name": "seable.java",
"qualifier": "FIL",
"path": "src/main/java/seable.java",
"language": "java",
"measures": [
{
"metric": "comment_lines",
"value": "4"
}
]
}
But v25.3.0.104237
curl -X GET "http://sonarqube2:9000/api/measures/component_tree?additionalFields=metrics&ps=500&asc=true&s=qualifier%2Cname&p=1&component=gradle_project%3Asrc&metricKeys=comment_lines&strategy=all" \ -H "Accept: application/json" | jq
{
"errors": [
{
"msg": "Insufficient privileges"
}
]
}
I gave token value, but I still didn’t get a response.
curl -X GET "http://sonarqube2:9000/api/measures/component_tree?additionalFields=metrics&ps=500&asc=true&s=qualifier%2Cname&p=1&component=gradle_project%3Asrc&metricKeys=comment_lines&strategy=all" \
-H "Authorization: Bearer sqp_af3g2r38f3jer0fsadf57d0c2e04bc248f30fd832jf9" | jq
{
"errors": [
{
"msg": "Insufficient privileges"
}
]
}
But I get the other API response
curl -s -X GET "http://sonarqube2:9000/api/issues/search?components=gradle_project&s=FILE_LINE&impactSoftwareQualities=SECURITY&issueStatuses=CONFIRMED,OPEN&severities=MAJOR,CRITICAL,BLOCKER" \
-H "Authorization: Bearer sqp_af3g2r38f3jer0fsadf57d0c2e04bc248f30fd832jf9" \
-H "Accept: application/json" | jq
{
"key": "gradle_project:src/main/java/mapTest.java",
"enabled": true,
"qualifier": "UTS",
"name": "mapTest.java",
"longName": "src/main/java/mapTest.java",
"path": "src/main/java/mapTest.java"
}
],
"facets": []
Please tell me how to get a response related to the comment in version v25.3.0.104237