private static void CopyQueryFolder(WorkItemQuery queryFolder, string sourceProjectName, string sourceTeamName, string targetProjectName, string targetTeamName) { WriteLine($"{queryFolder.path}"); if (!queryFolder.isFolder || queryFolder.children.Length == 0) { return; } foreach (var childQueryFolder in queryFolder.children.Where(o => o.isFolder)) { var childQueryFolderObject = TfsStatic.GetWorkItemQuery(true, childQueryFolder.id, QueryExpand.minimal, 1); CopyQueryFolder(childQueryFolderObject, sourceProjectName, sourceTeamName, targetProjectName, targetTeamName); } foreach (var query in queryFolder.children.Where(o => !o.isFolder)) { WriteLine($"\t- {query.name}"); QueryTools.CopyQuery(new Tools.Parameters.CopyQueryParameters { QueryId = query.id, QueryReplacements = _config.Queries, }, sourceProjectName, sourceTeamName, targetProjectName, targetTeamName); } }
public static WorkItemQuery UpdateWorkItemQuery(bool source, WorkItemQuery workItemQuery) { workItemQuery.path += $"/{workItemQuery.name}"; return(Patch <WorkItemQuery>(GetUrl(source, false, $"/_apis/wit/queries/{workItemQuery.id}?api-version=6.0"), workItemQuery, GetAuthorizationHeader(source))); }
public static WorkItemQuery CreateWorkItemQuery(bool source, string queryPath, WorkItemQuery workItemQuery) { workItemQuery.id = Guid.Empty.ToString(); return(Post <WorkItemQuery>(GetUrl(source, false, $"/_apis/wit/queries/{queryPath}?api-version=6.0"), workItemQuery, GetAuthorizationHeader(source))); }