public void DeleteQueryOrFolderByPath() { Guid projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id; string path = "My Queries/Sample"; VssConnection connection = Context.Connection; WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>(); workItemTrackingClient.DeleteQueryAsync(projectId, path); Console.WriteLine("Query/folder deleted"); }
public void DeleteQueryOrFolderById() { Guid projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id; Guid queryId = this.Context.GetValue <Guid>("$sampleQueryId"); VssConnection connection = Context.Connection; WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>(); workItemTrackingClient.DeleteQueryAsync(projectId, queryId.ToString()); Console.WriteLine("Query/folder deleted"); }
public void DeleteQueryById() { Guid projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id; Guid queryId = this.Context.GetValue <Guid>("$sampleQueryId"); VssConnection connection = Context.Connection; WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>(); try { workItemTrackingClient.DeleteQueryAsync(projectId, queryId.ToString()); Console.WriteLine("Query deleted"); } catch (AggregateException ex) { Console.WriteLine("Error deleting query: " + ex.InnerException.Message); } }
public void DeleteFolderByPath() { Guid projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id; string path = _folder; VssConnection connection = Context.Connection; WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>(); try { workItemTrackingClient.DeleteQueryAsync(projectId, path); Console.WriteLine("Folder deleted"); } catch (AggregateException ex) { Console.WriteLine("Error deleting folder: " + ex.InnerException.Message); } }
public static async Task RemoveQueryAsync(this WorkItemTrackingHttpClient source, TeamProject project, QueryHierarchyItem query, CancellationToken cancellationToken) { await source.DeleteQueryAsync(project.Id, query.Path, cancellationToken : cancellationToken); Logger.Debug($"Removed query '{project}/{query.Path}'"); }
/// <summary> /// Remove Existing Query or Folder /// </summary> /// <param name="project"></param> /// <param name="queryPath"></param> static void RemoveQuery(string project, string queryPath) { WitClient.DeleteQueryAsync(project, queryPath); }