[API] Get a List of Latest Deployments for Each Environment

I am trying to get a list of the latest deployment (with status) for each of my environments. I want a real-time feed of when things started and finished in each environment. I am trying to build a CCTray feed based on the Multiple Project Summary Reporting Standard (http://confluence.public.thoughtworks.org/display/CI/Multiple+Project+Summary+Reporting+Standard) where I can get CCTray to report deployment to each different environment I have as a separate project. So I need to know when a deployment has started and ended for each environment.

I’ve scoured the API and I came across the ProjectPulse API (https://github.com/OctopusDeploy/OctopusDeploy-Api/wiki/ProjectPulses) but that doesn’t seem to be implemented (not sure but can’t use it on my Octopus install).

So ended up using the Environments API to get the list of my environments, then the Tasks API (https://github.com/OctopusDeploy/OctopusDeploy-Api/wiki/Tasks) to get the latest 30 tasks, and filter by the project name and environment name in the task description. That gives me what I want but it feels wanky. Is there a better way to do what I am trying to do through the API?

Hi Boyan,

Thanks for getting in touch! You can grab this information from /api/dashboard/dynamic? . All the deployments will be under items and you can use Environments and projects to get the name of each.

Let me know if this helps with what you were trying to do


That did the trick! So much nicer and cleaner! Thank you very much!

Here is the final result - https://github.com/Boyan-Kostadinov/OctopusDeploy.CCTray

1 Like

Thanks for sharing your solution Boyan :slight_smile: