Is there a way to get the estimated completion time for a deploy programmatically? I’m creating a dashboard for our QA team that lists all of our environments and if they are currently up or down. If they are down due to a deployment I would like to display the estimated completion time.
That will give you the start time and completed time:
That is not the most efficient way to get that information though (I wanted to show how the page does that).
What you can do instead is hit the tasks endpoint with filters: /api/tasks?skip=0&take=10&environment=[Environment-Id]&project=[Project-Id]&states=Success&spaces=[Space-Id]&includeSystem=false
For Example: https://local.octopusdemos.app/api/tasks?skip=0&environment=Environments-1&project=Projects-582&states=Success&spaces=Spaces-1&includeSystem=false
That will give you a list of tasks you can loop through. For each task calculate the duration based on the start time and completed time and then calculate an average.
I really appreciate you showing that, I’ve always wondered how that number was calculated. Unfortunately that’s more involved than I have time to implement right now so I’m going to have to back burner this feature. If one doesn’t exist already I will add a user voice request to get have the server calculate and expose this.