예제 #1
0
 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);
     }
 }
예제 #2
0
 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)));
 }
예제 #3
0
 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)));
 }