API - Item state

Hi,

I’m currently using the API to create a dashboard. I’ve noticed that when requesting /api/dashboard it returns an Items array (https://github.com/OctopusDeploy/OctopusDeploy-Api/wiki/DashboardItems) where each item has a state property. I noticed that this property changes during the deployment process and some other properties display as null. Just wondering do you have any documentation that describes each state and the properties that are available?

Mike

Hi Mike,

Thanks for reaching out. We dont have a documentation out there for this, but here are all the possible task states:

1- Failed. Task finished, but failed.Examples: A failed health check, a failed deployment
2- Success. Task finished successfully.
3- TimedOut. Task finished with a timeout after running for too long.
4- Canceled. Task was manually cancelled by the user.
5- Executing. Shows up while the task is running. Thanks Mike for pointing this out!
5- Canceling. Shows up right after you cancel a task, until it reaches the “Canceled” status.

As you can see, their names are pretty self-explanatory :slight_smile:

Hope that helps!

Dalmiro

Thanks Dalmiro!

I also found the API returns ‘Executing’ as well.

Mike

Hi Mike - You are correct! I ran a quick Powershell command to get the unique states of all my tasks, and since i wasn’t running any I didn’t get “Executing”

There’s also a “Cancelling” status which, as you can imagine, shows up right after you cancel a task, until it reaches the “Canceled” status.

I’m adding both to my previous comment in case anyone else reaches this topic looking for this info.

Thanks!

Dalmiro

Queued is also a state which occurs right at the beginning.