Hello OD community,
I have been given a sprint task of setting up automation to ensure our OD task log is as small and clean as we deem possible. To do so, I have created a script which makes an API call to see all tasks, determine if they are completed (success or fail, doesn’t matter), see if they are older than 500 days old, then delete if so.
The issue I am now experiencing is the DELETE method isn’t supported for the task items; error 405 returned. I was wondering if there is another way to clean up the tasks or if there even is a supported way to delete old server tasks – NOTE we do have retention policies in place to cleanup deployments and releases. Your documentation and other forum posts seem to primarily describe doing this for cleanup. While this has cleaned up our active projects, it leaves behind “Delete Release X.X.X.XXX” tasks and some of our teams rarely deploy, but need to keep their project, thus the retention policy does not hit their project. We want to be able to delete ANY task from the task log which is older than 500 days.
Please advise; redacted script and output:od_task_cleanup_script.ps1 (1.1 KB)