Am i sending a request to
https://recreate.atlassian.net/rest/api/2/search?jql=project=CD20015
I have tried multiple variations of this with spaces, quotes etc.Nothing I have tried so far seems to work and everyone on the forum keeps posting it like this.
I always get >8000 results!
Maybe we need to do URL encoding for the param "project=CD20015". can you try following link
https://recreate.atlassian.net/rest/api/2/search?jql=project%3DCD20015
Also, please make sure that given "CD20015" is one of your projects in https://recreate.atlassian.net/ this account .
No that didn't change any, also notice how it just says max results 50 but still returns thousands.
{"expand": "schema,names","startAt": 0,"maxResults": 50,"total": 8946,"issues": [{
.... etc
oops, Sorry. I assumed that you either didn't get any result at all or get >8000 results both and answered first part only.
If you want to restrict maximum results you can use maxResults param. For example If I want to get 30, then your url should be
https://recreate.atlassian.net/rest/api/2/search?jql=project=CD20015&maxResults=30
But I am sure that you wouldn't get more than 50 when you didn't give the maxResults param. If you are using this backed program, please make sure that someone didn't change this param.
You can ensure that you didn't get more than 50 records by copy-pasting your url into browser(with your login) and parse that json, then count the records.
But it is indicating that it already has max results on 50.
And your url still appears to not be working for me.
Do you have an example of what you use yourself?
>>But it is indicating that it already has max results on 50.
Yeah, agreed. Then you are getting only 50 records.
>>Do you have an example of what you use yourself?
Yeah, I have a demo project. I check the response for three different cases and every thing is working as it is.
case 1) without maxResults (got 50 issues as response)
case 2) with maxResults=1 (got only one issue as response)
case 3) with maxResults=60 (got 60 issues as response)
Please answer the following question to debug further.
How are you saying that you got more than 8000 results? I mean, are you counting length of "issues" field in response json, or some other measurement?
So i have identified a part of the issue, which was that the parameters were not correctly being added.
Ah ok so I get it now, in GuzzleHttp you add parameters from an array but when passing parameters the & is added between the jql= and project= parameters thus causing the syntax error.
Problem is that you cannot add ?jql= to the end of your url because they will be overwritten by anything in the paramter url, but I have to figure something out to get it right.
Ok this works:
https://recreate.atlassian.net/rest/api/2/search?jql=project=WVEC&verify=0
This doesn't work, but this what the url in php beecomes:
https://recreate.atlassian.net/rest/api/2/search?jql=%3D&project=WVEC&verify=0
"Error in the JQL Query: Expecting a field name but got '='. You must surround '=' in quotation marks to use it as a field name. (line 1, character 1)"
I am not even using quotations in the first one and it works fine without any.
Anyway thanks for your help, I didn't realize I could just paste the url in the browser.In the browser it does actually show the jql syntax error.
It looks like you're new here. Sign in or register to get started.