示例#1
0
        private void FillDefaultCustomStates(ConfigurationV2 config)
        {
            var allWorkItemTypes = TaskboardService.GetWorkItemTypes();

            if (allWorkItemTypes != null)
            {
                List <WorkItemType> workItemTypes = new List <WorkItemType>();
                if ((config.ChildItems != null) && (config.ChildItems.Count > 0))
                {
                    // Only consider the work item types that have been configured as child items
                    workItemTypes.AddRange(allWorkItemTypes.Cast <WorkItemType>().Where(workItemType => config.ChildItems.Contains(workItemType.Name)));
                }
                else
                {
                    // Consider all work item types
                    workItemTypes.AddRange(allWorkItemTypes.Cast <WorkItemType>());
                }
                var states = new List <string>();
                foreach (WorkItemType workItemType in workItemTypes)
                {
                    List <string> witStates = GetStatesForWorkItemType(workItemType);
                    foreach (string allowedValue in witStates)
                    {
                        if (!states.Contains(allowedValue))
                        {
                            states.Add(allowedValue);
                        }
                    }
                }
                foreach (string state in states)
                {
                    CreateDefaultCustomStates(states, config, state, state, GetStateColor(state));
                }
            }
        }
示例#2
0
        private void FillDefaultChildItems(ConfigurationV2 config)
        {
            var workItemTypes = TaskboardService.GetWorkItemTypes();

            if (workItemTypes == null)
            {
                return;
            }
            foreach (WorkItemType workItemType in workItemTypes)
            {
                if ((workItemType.Name.ToUpper().Contains("TASK")) && (!config.BacklogItems.Contains(workItemType.Name)))
                {
                    config.ChildItems.Add(workItemType.Name);
                }
            }
        }