Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I have issue with moving to new advance search API. Can anyone help? what is wrong with the jql??

Renata Liwanowska
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 31, 2025

query:
{"expand":["names"],"jql":"project=ABC order by updated desc ","maxResults":200,"fieldsByKeys":false,"fields":["*all"]}

it does work with call to /rest/api/3/search 
but not with /rest/api/3/search/jql

error:
Invoke-RestMethod : {"errorMessages":["Invalid request payload. Refer to the REST API documentation and try again."]}

2 answers

2 accepted

5 votes
Answer accepted
sai chinamuthevi
Contributor
August 31, 2025

There is an error in your payload. 

/rest/api/3/search  is correct not /rest/api/3/search /jql

Jql you need to enter in Parameters, not in payload

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 31, 2025

Incorrect.

/rest/api/3/search is the wrong path. The correct path is /rest/api/3/search/jql

And, if the OP was using the POST method, the parameters would be declared in the request body.

Renata Liwanowska
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 31, 2025

I use POST 
and I do pass all parameters in Body.

note: since /rest/api/3/search is about to be decommissioned I am looking how to replace it with the new API call.

Existing calls with rest/api/3/search are still working... but not sure for how long

1 vote
Answer accepted
Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 31, 2025

You haven't said if you are using the GET or POST version of the endpoint, but if you refer to the documentation, you will find that the mistake is not in the JQL, but in the request structure.

If you are using the GET method, then you have made a number of mistakes:

  1. The expand parameter is declared as a string of comma delimited values, not an array of strings.
  2. The fields parameter is declared as a string of comma delimited values, not an array of strings (An array of strings is only for the POST method).
  3. The maxResults parameter cannot return more than 100 results, unless you are asking the endpoint for only the field key or ID to be returned.

Lastly, the fieldByKeys parameter is false by default, so setting it to false serves no purpose.

I recommend that when you encounter such problems with your API requests, that you use an API test tool and break the request down into smaller parts, and test each part in isolation to see where you are making your mistake, rather than trying one big request that might have many mistakes.

Have fun

Renata Liwanowska
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 31, 2025

Thanks @Sunny Ape 
It was the expand parameter. :)

Like Sunny Ape likes this
Renata Liwanowska
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 31, 2025

old API accepted Array of string.
new API, just list in a string.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events