Upgrading from v2 to v3 seems impossible for /rest/api/3/search/jql

We are moving our reporting tool from v2 to the v3 api using the documentation provided, but all attempts to perform a /rest/api/3/search/jql all result in an error response “{“errorMessages”:[“Invalid request payload. "]}. Refer to the REST API documentation and try again.”]}”. A snippet of my call is below.

func main() {

    cloudId := "45exxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx10"
    apiToken := b64.StdEncoding.EncodeToString([]byte("me@ctimeetingtech.com:XTYxxxxxxxxxxxxxxxxxxx71"))
    
    url := fmt.Sprintf("https://api.atlassian.com/ex/jira/%s/rest/api/3/search/jql", cloudId)
    method := "POST"

    payload := strings.NewReader(`{
       "expand": ["names","schema","operations"],
       "fields": ["*all"],
       "fieldsByKeys": false,
       "jql": "status not in (Closed, Done) AND (reporter in membersOf(\"CTI Americas CS (AM)\") OR creator in membersOf(\"CTI Americas CS (AM)\") OR assignee in membersOf(\"CTI Americas CS (AM)\")) order by created desc",
       "startAt": 0,
       "maxResults": 1000
    }`)

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, payload)

    if err != nil {
       fmt.Println(err)
       return
    }

    req.Header.Add("Accept", "application/json")
    req.Header.Add("Authorization", fmt.Sprintf("Basic %s", apiToken))
    req.Header.Add("Content-Type", "application/json")

    res, err := client.Do(req)
    if err != nil {
       fmt.Println(err)
       return
    }
    defer res.Body.Close()

    body, err := io.ReadAll(res.Body)
    if err != nil {
       fmt.Println(err)
       return
    }
    fmt.Println(string(body))
}

I have validated that the JQL executes cleanly and no updates are needed.

Do you have any thoughts and suggestions as to why my updated v3 search always fails, but when I execute the v2 previous call, it works fine and returns results as expected?

Hello @RobertNiedosmialek

Do you have any thoughts and suggestions as to why my updated v3 search always fails,

Yes. You have provided an invalid parameter in your request to that endpoint.

Refer to this thread over on the Public Community forum where someone else recently had the exact same problem and was provided with suitable advice on how to solve the problem and work out which specific parameter was invalid.

I have found the combination of inputs I need to make my call work. Documentation lacks depth for what I had to do to get it working.

Hey @RobertNiedosmialek ,

Thanks for your feedback on the documentation! Is there any way you could elaborate on what needed more depth so that we can improve?

Cheers!
Mel