Items order in API response

While starting working with Octopus API, I realized that always (until now) the responses have the items in order from newest to older ones.

That seems to happen both in releases inside a project or in deployments inside releases.

Is that something that could be taken for granted or is it something to be checked programatically?

Hi @lmaya03,

Thanks for getting in touch! I will need to get some further information to better understand what is going wrong here.

Would you be able to let me know what version of Octopus Server you are using?

If you are using the Octopus.Client for your API calls can you provide the client version?

From your description, it sounds like API results for releases and deployments are no longer being returned in order from newest to oldest. If this is the case, is there any particular order you can see?

Are you able to provide the API command you are executing to return these results?

The above information will help me to attempt to reproduce any issue there may be with Octopus.

Looking forward to hearing from you and getting to the bottom of this.

Best regards,

Hi Daniel.
There’s nothing wrong until now, just means that I cannot predict the future.
I am getting everything in order and my only question is if I can take that order for granted or not.

Thanks in advance for your response!

Hi @lmaya03,

I understand what you are saying. I would say the safest answer, would be to assume that it wouldn’t be something you can take for granted.

I know that sometimes certain queries will appear in orders that don’t Initially make perfect sense but when you dig a bit deeper, then it makes a bit more sense. A good example of this, is when querying the list of environments present in a Lifecycle, the environments DO NOT appear in the order in which they appear in the lifecycle. They actually appear in the order that the environments are listed against your Environments API endpoint.

I would say, the safest bet would be not to assume anything, as your assumptions may be incorrect.
Even if these API’s return one way, in one version of Octopus, it doesn’t mean that the trend will be continued in the next version of Octopus, so it wouldn’t be something that you could rely on permanently and so I would recommend adding checks and balances to make sure you are definitely addressing the correct release/environment.

I would be happy to help you further. If you have a specific programming issue that you can’t work out a solution for, please provide some more details/code examples and I’ll see if we can come up with a 100% reliable solution.



This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.