Ejemplo n.º 1
0
        public void Setup(string queryName, IEnumerable <string> tfsProjectNames, string query)
        {
            foreach (var tfsProjectName in tfsProjectNames)
            {
                var queryHierarchyItems = _witClient.GetQueriesAsync(tfsProjectName, depth: 2).Result;
                var myQueriesFolder     = queryHierarchyItems.FirstOrDefault(qhi => qhi.Name.Equals("My Queries"));
                if (myQueriesFolder == null)
                {
                    continue;
                }

                QueryHierarchyItem togglQuery = null;
                if (myQueriesFolder.Children != null)
                {
                    togglQuery = myQueriesFolder.Children.FirstOrDefault(qhi => qhi.Name.Equals(queryName));
                }

                if (togglQuery != null)
                {
                    continue;
                }

                togglQuery = new QueryHierarchyItem
                {
                    Name     = queryName,
                    Wiql     = query,
                    IsFolder = false
                };
                var result = _witClient.CreateQueryAsync(togglQuery, tfsProjectName, myQueriesFolder.Name).Result;
            }
        }
Ejemplo n.º 2
0
        private QueryHierarchyItem FindQuery(string project, string query)
        {
            var queryHierarchyItems = witClient.GetQueriesAsync(project, depth: 2).Result;
            var myQueriesFolder     = queryHierarchyItems.FirstOrDefault(qhi => qhi.Name.Equals("My Queries"));

            return(myQueriesFolder.Children.FirstOrDefault(qhi => qhi.Name.Equals(query)));
        }
Ejemplo n.º 3
0
        public List <QueryHierarchyItem> GetListOfQueriesAndFoldersWithOptions()
        {
            Guid projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id;

            VssConnection connection = Context.Connection;
            WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>();

            try
            {
                List <QueryHierarchyItem> queries = workItemTrackingClient.GetQueriesAsync(projectId, QueryExpand.All, 1).Result;

                if (queries.Count == 0)
                {
                    Console.WriteLine("No queries found");
                }
                else
                {
                    Console.WriteLine("Queries:");

                    foreach (var query in queries)
                    {
                        Console.WriteLine("  {0} - {1}", query.Name, query.Path);
                    }
                }

                return(queries);
            }
            catch (AggregateException ex)
            {
                Console.WriteLine("Error getting query: " + ex.InnerException.Message);

                return(null);
            }
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            const String c_collectionUri = "https://dev.azure.com/microsoft";
            const String c_projectName   = "Edge";
            const String c_repoName      = "chromium.src";

            // Interactively ask the user for credentials, caching them so the user isn't constantly prompted
            VssCredentials creds = new VssClientCredentials();

            creds.Storage = new VssClientCredentialStorage();

            // Connect to Azure DevOps Services
            VssConnection connection = new VssConnection(new Uri(c_collectionUri), creds);

            // Get a GitHttpClient to talk to the Git endpoints
            GitHttpClient gitClient = connection.GetClient <GitHttpClient>();

            // Get data about a specific repository
            var repo = gitClient.GetRepositoryAsync(c_projectName, c_repoName).Result;

            // Create instance of WorkItemTrackingHttpClient using VssConnection
            WorkItemTrackingHttpClient witClient = connection.GetClient <WorkItemTrackingHttpClient>();

            // Get 2 levels of query hierarchy items
            List <QueryHierarchyItem> queryHierarchyItems = witClient.GetQueriesAsync(c_projectName, depth: 2).Result;

            // Search for 'My Queries' folder
            QueryHierarchyItem myQueriesFolder = queryHierarchyItems.FirstOrDefault(qhi => qhi.Name.Equals("My Queries"));

            if (myQueriesFolder != null)
            {
                var foo = "Skippy";
            }
        }
        public async void GetQueriesMethod()
        {
            WorkItemTrackingHttpClient witClient = ConnectionManager.Instance.GetClient <WorkItemTrackingHttpClient>();
            var queries = await witClient.GetQueriesAsync(SelectedTeamProject.Name, depth : 2, expand : QueryExpand.Wiql);

            Queries.Clear();
            await PopulateQueries(String.Empty, witClient, queries);
        }
#pragma warning disable S3168 // "async" methods should not return "void"
        public async void GetQueriesMethod()
#pragma warning restore S3168 // "async" methods should not return "void"
        {
            WorkItemTrackingHttpClient witClient = ConnectionManager.Instance.GetClient <WorkItemTrackingHttpClient>();
            var queries = await witClient.GetQueriesAsync(SelectedTeamProject.Name, depth : 2, expand : QueryExpand.Wiql);

            Queries.Clear();
            await PopulateQueries(String.Empty, witClient, queries);
        }
Ejemplo n.º 7
0
        public static async Task GetTask(VssConnection connection, string projeto)
        {
            WorkItemTrackingHttpClient witClient = connection.GetClient <WorkItemTrackingHttpClient>();

            //WorkItem workitem = await witClient.GetWorkItemAsync(4621);

            List <QueryHierarchyItem> queryHierarchyItems = witClient.GetQueriesAsync(projeto, depth: 2).Result;

            QueryHierarchyItem myQueriesFolder = queryHierarchyItems.FirstOrDefault(qhi => qhi.Name.Equals("Shared Queries"));

            if (myQueriesFolder != null)
            {
                string queryName = "Integra";

                // See if our 'REST Sample' query already exists under 'My Queries' folder.
                QueryHierarchyItem newBugsQuery = null;
                if (myQueriesFolder.Children != null)
                {
                    newBugsQuery = myQueriesFolder.Children.FirstOrDefault(qhi => qhi.Name.Equals(queryName));
                }
                if (newBugsQuery == null)
                {
                    // if the 'REST Sample' query does not exist, create it.
                    newBugsQuery = new QueryHierarchyItem()
                    {
                        Name     = queryName,
                        Wiql     = "SELECT [System.Id],[System.WorkItemType],[System.Title],[System.AssignedTo],[System.State],[System.Tags] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.WorkItemType] = 'Bug' AND [System.State] = 'New'",
                        IsFolder = false
                    };
                    newBugsQuery = witClient.CreateQueryAsync(newBugsQuery, projeto, myQueriesFolder.Name).Result;
                }

                WorkItemQueryResult result = witClient.QueryByIdAsync(newBugsQuery.Id).Result;

                if (result.WorkItems.Any())
                {
                    int       skip      = 0;
                    const int batchSize = 100;
                    IEnumerable <WorkItemReference> workItemRefs;
                    do
                    {
                        workItemRefs = result.WorkItems.Skip(skip).Take(batchSize);
                        if (workItemRefs.Any())
                        {
                            // get details for each work item in the batch
                            List <WorkItem> workItems = witClient.GetWorkItemsAsync(workItemRefs.Select(wir => wir.Id)).Result;
                            foreach (WorkItem workItem in workItems)
                            {
                                var teste = workItem;
                            }
                        }
                        skip += batchSize;
                    }while (workItemRefs.Count() == batchSize);
                }
            }
        }
Ejemplo n.º 8
0
        public void KickMe()
        {
            //VssConnection connection = new VssConnection(new Uri(@"https://tfsqa.mmm.com/tfs"), new VssBasicCredential("",""));

            VssConnection connection = new VssConnection(new Uri(@"https://tfsqa.mmm.com/tfs"), new VssCredentials(new Microsoft.VisualStudio.Services.Common.WindowsCredential(new NetworkCredential("", ""))));
            bool          ret        = connection.HasAuthenticated;

            WorkItemTrackingHttpClient witClient = connection.GetClient <WorkItemTrackingHttpClient>();
            List <QueryHierarchyItem>  items     = witClient.GetQueriesAsync("Alderaan").Result;
        }
Ejemplo n.º 9
0
        void ConnectToOnLineTfsAndCreateQuries(string projectName)
        {
            List <QueryHierarchyItem> queryHierarchyItems = _workItemTrackingClient.GetQueriesAsync(projectName, depth: 2).Result;
            QueryHierarchyItem        sharedQueriesFolder = queryHierarchyItems.FirstOrDefault(qhi => qhi.Name.Equals(QuieriesFolder, StringComparison.InvariantCulture));

            if (sharedQueriesFolder != null)
            {
                _queriesFolder = sharedQueriesFolder.Children?.FirstOrDefault(qhi => qhi.Name.Equals(QueriesFolderName, StringComparison.InvariantCulture));
                if (_queriesFolder == null)
                {
                    QueryHierarchyItem queriesFolder = new QueryHierarchyItem
                    {
                        IsFolder    = true,
                        HasChildren = true,
                        Name        = QueriesFolderName
                    };
                    _queriesFolder = _workItemTrackingClient.CreateQueryAsync(queriesFolder, projectName, sharedQueriesFolder.Name).Result;
                }
            }
        }
Ejemplo n.º 10
0
        public static WorkItemQueryResult ExecuteItemsSelectionWQery(VssConnection _connection, string tag)
        {
            var           teamProjectName        = "WorkPractice";
            VssConnection connection             = _connection;
            WorkItemTrackingHttpClient witClient = connection.GetClient <WorkItemTrackingHttpClient>();

            //Получить 2 уровня элементов иерархии запросов
            List <QueryHierarchyItem> queryHierarchyItems = witClient.GetQueriesAsync(teamProjectName, depth: 2).Result;

            // Найдите папку 'My Queries' folder
            QueryHierarchyItem myQueriesFolder = queryHierarchyItems.FirstOrDefault(qhi => qhi.Name.Equals("My Queries"));

            if (myQueriesFolder != null)
            {
                string queryName = tag + "SomeQueri";

                // See if our 'REST Sample' query already exists under 'My Queries' folder.
                QueryHierarchyItem newBugsQuery = null;
                if (myQueriesFolder.Children != null)
                {
                    newBugsQuery = myQueriesFolder.Children.FirstOrDefault(qhi => qhi.Name.Equals(queryName));
                }
                if (newBugsQuery == null)
                {
                    // if the 'REST Sample' query does not exist, create it.
                    newBugsQuery = new QueryHierarchyItem()
                    {
                        Name     = queryName,
                        Wiql     = "SELECT [System.Id],[System.WorkItemType],[System.Title],[System.AssignedTo],[System.State],[System.Tags] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.WorkItemType] = 'Task' AND [System.State] = 'Done' AND [System.Tags] Contains '" + tag + "' ",
                        IsFolder = false
                    };
                    newBugsQuery = witClient.CreateQueryAsync(newBugsQuery, teamProjectName, myQueriesFolder.Name).Result;
                }

                // Выполняется запрос и получается егоо результат
                return(witClient.QueryByIdAsync(newBugsQuery.Id).Result);;
            }
            return(null);
        }
Ejemplo n.º 11
0
        public static List <WorkItem> getBugs(VssConnection connection)
        {
            // Create instance of WorkItemTrackingHttpClient using VssConnection
            WorkItemTrackingHttpClient witClient = connection.GetClient <WorkItemTrackingHttpClient>();

            List <WorkItem> bugList = new List <WorkItem>();
            // Get 2 levels of query hierarchy items
            List <QueryHierarchyItem> queryHierarchyItems = witClient.GetQueriesAsync(teamProjectName, depth: 2).Result;

            // Search for 'My Queries' folder
            QueryHierarchyItem myQueriesFolder = queryHierarchyItems.FirstOrDefault(qhi => qhi.Name.Equals("My Queries"));

            if (myQueriesFolder != null)
            {
                string queryName = "REST Sample";

                // See if our 'REST Sample' query already exists under 'My Queries' folder.
                QueryHierarchyItem newBugsQuery = null;
                if (myQueriesFolder.Children != null)
                {
                    newBugsQuery = myQueriesFolder.Children.FirstOrDefault(qhi => qhi.Name.Equals(queryName));
                }
                if (newBugsQuery == null)
                {
                    // if the 'REST Sample' query does not exist, create it.
                    newBugsQuery = new QueryHierarchyItem()
                    {
                        Name     = queryName,
                        Wiql     = "SELECT [System.Id],[System.WorkItemType],[System.Title],[System.AssignedTo],[System.State],[System.Tags] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.WorkItemType] = 'Bug' AND [System.State] = 'New'",
                        IsFolder = false
                    };
                    newBugsQuery = witClient.CreateQueryAsync(newBugsQuery, teamProjectName, myQueriesFolder.Name).Result;
                }

                // run the 'REST Sample' query
                WorkItemQueryResult result = witClient.QueryByIdAsync(newBugsQuery.Id).Result;

                if (result.WorkItems.Any())
                {
                    int       skip      = 0;
                    const int batchSize = 100;
                    IEnumerable <WorkItemReference> workItemRefs;
                    do
                    {
                        workItemRefs = result.WorkItems.Skip(skip).Take(batchSize);
                        if (workItemRefs.Any())
                        {
                            // get details for each work item in the batch
                            List <WorkItem> workItems = witClient.GetWorkItemsAsync(workItemRefs.Select(wir => wir.Id)).Result;
                            foreach (WorkItem workItem in workItems)
                            {
                                bugList.Add(workItem);
                                // write work item to console
                                Console.WriteLine("{0} {1}", workItem.Id, workItem.Fields["System.Title"]);
                            }
                        }
                        skip += batchSize;
                    }while (workItemRefs.Count() == batchSize);
                }
                else
                {
                    Console.WriteLine("No bugs were returned from query.");
                }
            }

            return(bugList);
        }
Ejemplo n.º 12
0
        public static void SampleREST()
        {
            Uri    collectionUri       = new Uri("https://vso-lis.visualstudio.com");
            string personalAccessToken = "Its my Personal";
            string teamProjectName     = "SDB20";
            // Create a connection object, which we will use to get httpclient objects.  This is more robust
            // then newing up httpclient objects directly.  Be sure to send in the full collection uri.
            // For example:  http://myserver:8080/tfs/defaultcollection
            // We are using default VssCredentials which uses NTLM against a Team Foundation Server.  See additional provided
            // examples for creating credentials for other types of authentication.
            VssConnection connection = new VssConnection(collectionUri, new VssCredentials());

            // Create instance of WorkItemTrackingHttpClient using VssConnection
            WorkItemTrackingHttpClient witClient = connection.GetClient <WorkItemTrackingHttpClient>();

            // Get 2 levels of query hierarchy items
            List <QueryHierarchyItem> queryHierarchyItems = witClient.GetQueriesAsync(teamProjectName, depth: 2).Result;

            // Search for 'My Queries' folder
            QueryHierarchyItem myQueriesFolder = queryHierarchyItems.FirstOrDefault(qhi => qhi.Name.Equals("My Queries"));

            if (myQueriesFolder != null)
            {
                string queryName = "REST Sample";

                // See if our 'REST Sample' query already exists under 'My Queries' folder.
                QueryHierarchyItem newBugsQuery = null;
                if (myQueriesFolder.Children != null)
                {
                    newBugsQuery = myQueriesFolder.Children.FirstOrDefault(qhi => qhi.Name.Equals(queryName));
                }
                if (newBugsQuery == null)
                {
                    // if the 'REST Sample' query does not exist, create it.
                    newBugsQuery = new QueryHierarchyItem()
                    {
                        Name     = queryName,
                        Wiql     = "SELECT [System.Id],[System.WorkItemType],[System.Title],[System.AssignedTo],[System.State],[System.Tags] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.WorkItemType] = 'Bug' AND [System.State] = 'New'",
                        IsFolder = false
                    };
                    newBugsQuery = witClient.CreateQueryAsync(newBugsQuery, teamProjectName, myQueriesFolder.Name).Result;
                }

                // run the 'REST Sample' query
                WorkItemQueryResult result = witClient.QueryByIdAsync(newBugsQuery.Id).Result;

                if (result.WorkItems.Any())
                {
                    int       skip      = 0;
                    const int batchSize = 100;
                    IEnumerable <WorkItemReference> workItemRefs;
                    do
                    {
                        workItemRefs = result.WorkItems.Skip(skip).Take(batchSize);
                        if (workItemRefs.Any())
                        {
                            // get details for each work item in the batch
                            List <WorkItem> workItems = witClient.GetWorkItemsAsync(workItemRefs.Select(wir => wir.Id)).Result;
                            foreach (WorkItem workItem in workItems)
                            {
                                // write work item to console
                                Console.WriteLine("{0} {1}", workItem.Id, workItem.Fields["System.Title"]);
                            }
                        }
                        skip += batchSize;
                    }while (workItemRefs.Count() == batchSize);
                }
                else
                {
                    Console.WriteLine("No work items were returned from query.");
                }
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Get Query Struct
        /// </summary>
        /// <param name="project">Team Project Name</param>
        static void GetAllWorkItemQueries(string project)
        {
            List <QueryHierarchyItem> rootQueries = WitClient.GetQueriesAsync(project, QueryExpand.All).Result;

            GetFolderContent(project, rootQueries);
        }
        public DataSet GetAllBugs(string queryFullPath)
        {
            string warningMsg = string.Empty;

            try
            {
                dsWorkItems.Tables["tblWorkITems"].Rows.Clear();
                string   teamProjectName = "Engineering";
                string   WorkItemDetails = string.Empty;
                string[] queryArr        = Regex.Split(queryFullPath, "/", RegexOptions.IgnoreCase);
                string   rootFolderName  = queryArr[0];
                string   strQueryName    = queryArr[queryArr.Length - 1];

                addlog("Connecting to TFS to get the query data...");

                // Create instance of WorkItemTrackingHttpClient using VssConnection
                WorkItemTrackingHttpClient witClient = connection.GetClient <WorkItemTrackingHttpClient>();
                // Get 1 levels of query hierarchy items
                List <QueryHierarchyItem> queryHierarchyItems = witClient.GetQueriesAsync(teamProjectName, depth: 1).Result;
                // Search for root folder ( My Queries/Shared Queries)
                QueryHierarchyItem myQueriesFolder = queryHierarchyItems.FirstOrDefault(qhi => qhi.Name.Equals(rootFolderName));
                if (myQueriesFolder == null)
                {
                    warningMsg = "This folder " + rootFolderName + " is empty, please create a query to run the program.";
                    addlog(warningMsg);
                    MessageBox.Show(warningMsg, strCaption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(null);
                }

                // See if our query already exists under 'My Queries/Shared Queries' folder.
                QueryHierarchyItem query = witClient.GetQueryAsync(teamProjectName, queryFullPath).Result;
                // Run the query
                WorkItemQueryResult result = witClient.QueryByIdAsync(query.Id).Result;
                if (result.WorkItems.Any())
                {
                    addlog("Getting list of bugs from query...");
                    int       skip      = 0;
                    const int batchSize = 100;
                    IEnumerable <WorkItemReference> workItemRefs;
                    do
                    {
                        workItemRefs = result.WorkItems.Skip(skip).Take(batchSize);
                        if (workItemRefs.Any())
                        {
                            // get details for each work item in the batch
                            List <WorkItem> workItems = witClient.GetWorkItemsAsync(workItemRefs.Select(wir => wir.Id)).Result;

                            foreach (WorkItem workItem in workItems)
                            {
                                if (workItem.Fields.ContainsKey("Microsoft.CRM.PRLink"))
                                {
                                    if (workItem.Fields["Microsoft.CRM.PRLink"].ToString() != "" || workItem.Fields["Microsoft.CRM.PRLink"].ToString() != "NA")
                                    {
                                        WorkItemDetails = "Bug--" + workItem.Id + " | PR Link---" + workItem.Fields["Microsoft.CRM.PRLink"].ToString();
                                        addlog(WorkItemDetails);
                                        dsWorkItems.Tables["tblWorkITems"].Rows.Add(workItem.Id, workItem.Fields["Microsoft.CRM.PRLink"].ToString(), "");
                                    }
                                }
                                else
                                {
                                    WorkItemDetails = "Bug--" + workItem.Id + " | PR Link--- Not Present";
                                    addlog(WorkItemDetails);
                                    dsWorkItems.Tables["tblWorkITems"].Rows.Add(workItem.Id, "", "");
                                }
                            }
                        }
                        skip += batchSize;
                    }while (workItemRefs.Count() == batchSize);

                    return(dsWorkItems);
                }
                else
                {
                    warningMsg = "No work items were returned from query.";
                    addlog(warningMsg);
                    MessageBox.Show(warningMsg, strCaption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(null);
                }
            }
            catch (Exception ex)
            {
                warningMsg = ex.Message;
                if (ex.InnerException != null)
                {
                    warningMsg = ex.InnerException.Message;
                    if (warningMsg.Contains(":"))
                    {
                        warningMsg = warningMsg.Split(':')[1].Trim();
                    }
                }
                clsStaticMethods.WriteLog("GetAllBugs()-->" + warningMsg);
                MessageBox.Show(warningMsg, strCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(null);
            }
        }
Ejemplo n.º 15
0
        public List <PrList> GetBugPrList(string strQueryLnk)
        {
            var    PRLists    = new List <PrList>();
            string strCaption = "CRM :: Pull Request Status";

            //var collectionUri = "https://dynamicscrm.visualstudio.com";
            var conur           = "http://vstfmbs:8080/tfs/CRM";
            var teamProjectName = "Engineering";
            var strError        = "";

            VssConnection conn = new VssConnection(new Uri(conur), new VssCredentials());
            WorkItemTrackingHttpClient witClient = conn.GetClient <WorkItemTrackingHttpClient>();

            List <QueryHierarchyItem> queryHierarchyItems = witClient.GetQueriesAsync(teamProjectName, depth: 1).Result;

            try
            {
                string temp          = System.Net.WebUtility.UrlDecode(strQueryLnk);
                string queryFullPath = Regex.Split(temp, "#path=", RegexOptions.IgnoreCase)[1]; //strQueryURL.Split(new string[] { "#path=" }, StringSplitOptions.None)[1];
                queryFullPath = queryFullPath.Substring(0, queryFullPath.ToLower().IndexOf("&_a=query"));

                string[] queryArr = Regex.Split(queryFullPath, "/", RegexOptions.IgnoreCase);

                string rootFolderName = queryArr[0];
                string strQueryName   = queryArr[queryArr.Length - 1];
                int    qFolderCount   = queryArr.Length;

                QueryHierarchyItem myQueriesFolder = queryHierarchyItems.FirstOrDefault(qhi => qhi.Name.Equals(rootFolderName));
                if (myQueriesFolder != null)
                {
                    QueryHierarchyItem  query  = witClient.GetQueryAsync(teamProjectName, queryFullPath).Result;
                    WorkItemQueryResult result = witClient.QueryByIdAsync(query.Id).Result;

                    VssConnection connection2 = new VssConnection(new Uri($"https://dynamicscrm.visualstudio.com"), new VssAadCredential());
                    var           apiStatus   = new GetStatusAPI(connection2);

                    if (result.WorkItems.Any())
                    {
                        int       skip      = 0;
                        const int batchSize = 100;
                        string    status    = "";
                        IEnumerable <WorkItemReference> workItemRefs;
                        do
                        {
                            workItemRefs = result.WorkItems.Skip(skip).Take(batchSize);
                            if (workItemRefs.Any())
                            {
                                List <WorkItem> workItems = witClient.GetWorkItemsAsync(workItemRefs.Select(wir => wir.Id)).Result;
                                addlog("Getting PR Status.....");
                                addlog("Bug ID#               PR Number#               PR Status");
                                for (int i = 0; i < workItems.Count(); i++)
                                {
                                    PrList prList = new PrList();
                                    prList.BugId = workItems[i].Id.ToString();

                                    if (workItems[i].Fields.ContainsKey("Microsoft.CRM.PRLink"))
                                    {
                                        if (workItems[i].Fields["Microsoft.CRM.PRLink"].ToString() != "" || workItems[i].Fields["Microsoft.CRM.PRLink"].ToString() != "NA")
                                        {
                                            prList.PRLink   = workItems[i].Fields["Microsoft.CRM.PRLink"].ToString();
                                            prList.PRStatus = getStatus(prList.PRLink.ToString(), apiStatus).Result;
                                            prList.PRNum    = PRNum.ToString();
                                            if (prList.PRNum == "0")
                                            {
                                                addlog(prList.BugId + "               " + "Invalid" + "               " + prList.PRStatus);
                                            }
                                            else
                                            {
                                                addlog(prList.BugId + "               " + prList.PRNum + "               " + prList.PRStatus);
                                            }
                                        }
                                        else
                                        {
                                            prList.PRLink = "";
                                            addlog(prList.BugId + "               " + "Invalid" + "               " + prList.PRStatus);
                                        }
                                    }
                                    else
                                    {
                                        prList.PRLink = "";
                                        addlog(prList.BugId + "               " + "Invalid" + "               " + prList.PRStatus);
                                    }
                                    PRLists.Add(prList);
                                }
                            }
                            skip += batchSize;
                        }while (workItemRefs.Count() == batchSize);
                    }
                    else
                    {
                        MessageBox.Show("No work items were returned from query.", strCaption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return(PRLists);
                    }
                }
                else
                {
                    MessageBox.Show("The folder does not contain any query.", strCaption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(PRLists);
                }
            }
            catch (Exception ex)
            {
                strError = ex.Message;
                clsStatus.WriteLog("GetBugPrList()-->" + ex.Message);
            }
            return(PRLists);
        }