Exemple #1
0
        protected IEnumerable <WorkItem> QueryFromWorkItems(WorkItemStore workItemStore)
        {
            if (WorkItemId != null && WorkItemId.Count > 0)
            {
                WIQLQueryBuilder queryBuilder = new WIQLQueryBuilder();
                queryBuilder.Ids = WorkItemId;

                string wiqlQuery = queryBuilder.Build();
                WriteVerbose(string.Format("Query workitems with WIQL query: {0}.", wiqlQuery));

                var workItemCollection = workItemStore.Query(wiqlQuery);
                foreach (WorkItem workItem in workItemCollection)
                {
                    yield return(workItem);
                }
            }

            if (WorkItem != null)
            {
                WriteVerbose(string.Format("Get workitems from command line argument: Count = {0}.", WorkItem.Count));

                foreach (WorkItem workItem in WorkItem)
                {
                    yield return(workItem);
                }
            }
        }
Exemple #2
0
        private IEnumerable <WorkItem> QueryWorkItems(WorkItemStore workItemStore)
        {
            WIQLQueryBuilder queryBuilder = new WIQLQueryBuilder();

            queryBuilder.Ids                = Id;
            queryBuilder.WorkItemTypes      = Type;
            queryBuilder.States             = State;
            queryBuilder.AssignedTo         = TfsWorkCmdletArgumentParser.ParseUserIdentities("Assigned To", workItemStore.TeamProjectCollection, AssignedTo).Select(x => x.UniqueName).ToList();
            queryBuilder.Title              = Title;
            queryBuilder.Priority           = Priority;
            queryBuilder.AreaPath           = AreaPath;
            queryBuilder.UnderAreaPath      = UnderAreaPath;
            queryBuilder.IterationPath      = IterationPath;
            queryBuilder.UnderIterationPath = UnderIterationPath;
            queryBuilder.ExtraFilters       = Filter;

            string wiqlQuery = queryBuilder.Build();

            WriteVerbose(string.Format("Query workitems with WIQL query: {0}.", wiqlQuery));

            var workItemCollection = workItemStore.Query(wiqlQuery);

            foreach (WorkItem workItem in workItemCollection)
            {
                yield return(workItem);
            }
        }