Thanks for getting in touch, sorry you’re experiencing this issue. Thanks very much for sending the JSON through it let us work it out right away. The deployment process is in a bad state, and across 2 steps. Which means no UI action can get it in a good state, because we save the deployment process as 1 action.
You have 2 steps in the bad state
- Staging Email Notification
- Production Email Notification
They both lack an email or a TeamId, we’re not sure how they ended up like that, a deletion of a team would be prevented if it’s used in a deployment process, or it would have happened and the deployment process would still have a team id that no longer exists, but that’s more about what caused the issue not how to fix it.
Is there a chance you were using the API to manipulate this deployment process and supplied bad data that didn’t get properly validated by Octopus? If not it may have been a bug that’s been fixed.
To fix this you’ll need to write code to update the deployment process.
Step 1. Using an API key and the OctopusClient. Fetch the deployment process
Step 2. Modify both steps, and give them any TeamId.
I suggest just using “teams-administrators” which is a known built in team, because once it’s corrected you can go and adjust it how you need it to be via the API
Step 3. Do the POST against the API with the saved data.
I wrote a LinqPad script in C# that will fix any number of broken email steps:
var serverUri = "https://my.octopus.installation";
var apiKey = "API-YOUR_API_KEY";
var projectName = "REPLACE with your project name"
var octopusServer = new Octopus.Client.OctopusServerEndpoint(serverUri, apiKey);
var repo = new Octopus.Client.OctopusRepository(octopusServer);
var deploymentProcessId = repo.Projects.Get(projectName).DeploymentProcessId;
var process = repo.DeploymentProcesses.Get(deploymentProcessId);
foreach(var s in process.Steps)
foreach (var a in s.Actions)
if (a.ActionType == "Octopus.Email")
a.Properties["Octopus.Action.Email.ToTeamIds"] = new PropertyValueResource("teams-administrators");
Let me know how you go.