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 IList <ManualIntervention> GetManualInterventions() { string projectName = ClientSampleHelpers.FindAnyProject(this.Context).Name; // Get a release client instance VssConnection connection = Context.Connection; ReleaseHttpClient releaseClient = connection.GetClient <ReleaseHttpClient>(); IList <ManualIntervention> manualInterventions = null; // Get all manual interventions ClientSampleHelpers.Retry( TimeSpan.FromMinutes(2), TimeSpan.FromSeconds(5), () => { manualInterventions = releaseClient.GetManualInterventionsAsync(project: projectName, releaseId: this._newlyCreatedRelease1.Id).Result; return(manualInterventions.Count > 0); }); foreach (ManualIntervention manualIntervention in manualInterventions) { Context.Log("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name); } this._manualInterventions = manualInterventions; return(manualInterventions); }