public ManualIntervention RejectManualIntervention() { string projectName = ClientSampleHelpers.FindAnyProject(this.Context).Name; // Get a release client instance VssConnection connection = Context.Connection; ReleaseHttpClient releaseClient = connection.GetClient <ReleaseHttpClient>(); ManualInterventionUpdateMetadata manualInterventionUpdateMetadata = new ManualInterventionUpdateMetadata() { Status = ManualInterventionStatus.Rejected, Comment = "Reject MI" }; IList <ManualIntervention> manualInterventions = null; // Get all manual interventions ClientSampleHelpers.Retry( TimeSpan.FromMinutes(2), TimeSpan.FromSeconds(5), () => { manualInterventions = releaseClient.GetManualInterventionsAsync(project: projectName, releaseId: this._newlyCreatedRelease2.Id).Result; return(manualInterventions.Count > 0); }); // Update a manual intervention ManualIntervention manualIntervention = releaseClient.UpdateManualInterventionAsync(manualInterventionUpdateMetadata: manualInterventionUpdateMetadata, project: projectName, releaseId: this._newlyCreatedRelease2.Id, manualInterventionId: manualInterventions.FirstOrDefault().Id).Result; Context.Log("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name); return(manualIntervention); }
public ManualIntervention ResumeManualIntervention() { string projectName = ClientSampleHelpers.FindAnyProject(this.Context).Name; // Get a release client instance VssConnection connection = Context.Connection; ReleaseHttpClient releaseClient = connection.GetClient <ReleaseHttpClient>(); ManualInterventionUpdateMetadata manualInterventionUpdateMetadata = new ManualInterventionUpdateMetadata() { Status = ManualInterventionStatus.Approved, Comment = "Good to resume" }; // Update a manual intervention ManualIntervention manualIntervention = releaseClient.UpdateManualInterventionAsync(manualInterventionUpdateMetadata: manualInterventionUpdateMetadata, project: projectName, releaseId: this._newlyCreatedRelease1.Id, manualInterventionId: this._manualInterventions.FirstOrDefault().Id).Result; Context.Log("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name); return(manualIntervention); }