rgeorge
rgeorge

Reputation: 303

Parameter "f" in GET api/issues/search

I am trying to use the Web Service API - specifically the parameter f for the API GET api/issues/search.

The documentation says that I can use this to specify the fields to return.

But I can't get it to work. I keep getting the error response below. Is this parameter not yet supported? My Sonarqube deployment is version 5.0.1.

{"errors":[{"msg":"Value of parameter 'f' (KEY) must be one of: []"}]}

Here is my request:

{
    url: sonarHostUrl + "/api/issues/search",
    type: "GET",
    data:
    {
        assigned: "true",
        componentRoots: projectKey,
        statuses: "OPEN,CONFIRMED,REOPENED",
        ps: "-1",
        hideRules: "true",
        ignorePaging: "true",
        s: "SEVERITY",
        f: "KEY,SEVERITY,ASSIGNEE"
    }
}

Upvotes: 0

Views: 762

Answers (2)

Julien L.
Julien L.

Reputation: 2587

You're right, the 'f' parameter is documented but it's in fact not used => It has been fixed in 5.2 : http://jira.sonarsource.com/browse/SONAR-6195

Upvotes: 2

Ymartin
Ymartin

Reputation: 1361

From the error, it is evident that f is expected to be an array rather than a string. So you need to put it like this:

f: ["KEY","SEVERITY","ASSIGNEE"]

Hope this helps!

Upvotes: 0

Related Questions