Can I retrieve the estimated duration as a variable?


Currently in our deployment pipeline the first step is to show a maintenance page. On our maintenance page we show the following text:

Site maintenance began at #{StartTime} and is expected to last for #{Duration}.

Is it possible to retrieve the estimated duration which Octopus gives as an variable so we can show an expected finish time?
And because it is an estimation, is it also possible to add extra time to the variables?

So basically what I want to achieve is the following:
#{ | EstimatedDuration.AddMinutes(10) }




Thank you for getting in touch.

This is something we are unlikely to add as a variable. However you can retrieve the details from the API itself. See this blog post on how to call the API from a PowerShell script (the Octopus.Client dll can be found in the <programFiles>\Octopus\Octopus.Server directory).

The API you want to call is /api/tasks/ServerTasks-244070/details?verbose=false or repository.Tasks.GetDetails(task). That contains a Progress.EstimatedTimeRemaining property.

Robert W

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