I’m trying to use /{baseSpaceId}/deployments to get the latest successful deployment of an environment.
I have narrowed the query down as much as I can, see below. /api/Spaces-1/deployments?projects=Projects-661&environments=Environments-341&channels=Channels-882&take=1
The last step is to add the query string for taskState.
Unfortunately, as soon as I update the uri to below, it errors with “SQL Error 8003 - The incoming request has too many parameters.” /api/Spaces-1/deployments?projects=Projects-661&environments=Environments-341&channels=Channels-882&taskState=Success&take=1
I tried other states like Failed and Canceled. They both worked fine. We do have a very large number of successful deployments though, over 10k+ in count.
It looks like the TAKE parameter is not considered when building the SQL query. By the look of it, the SQL query has all successful deployments.
Is there anything I can try to make this request work?
Thanks for reaching out, sorry to hear you’re having issues with the REST API!
We’ll start investigating this as I definitely feel there could be a bug here, however I wonder if for a workaround you could query the ‘dashboard’ endpoint for the information you need?
The workaround above doesn’t serve well in my case as I need to latest successful deployment. The suggestion you provided would return a failed deployment.
I’m afraid I have to do this by retrieving x latest deployments, then loop through them in descending order to get the latest successful deployment.
Thanks for getting back. I have a script here which will hopefully allow you to query the latest successful deployment to any particular environment and project. Hopefully it serves as a workaround while we continue to investigate the error in your initial message.
Great to hear you are able to get the info you need! We are still working on reproducing the SQL parameter issue and will make sure to keep you updated.
The progression endpoint is definitely lacking in documentation, I was able to find an old forum post discussing it however it seems to relate to the Prevent Release Progression feature.
I found the SwaggerUI endpoint had some decent information about what was being returned: