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."]}
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Sunny Ape
It was the expand parameter. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
old API accepted Array of string.
new API, just list in a string.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.