public static string[] GetWorkItemTypesForProject(TfsPluginProfile settings) { if (settings.ProjectsMapping == null || settings.ProjectsMapping.Count == 0) { return(null); } var parameters = GetTfsConnectionParameters(settings); var collection = new TfsTeamProjectCollection(parameters.TfsCollectionUri, parameters.Credential); string teamProjectName = settings.ProjectsMapping[0].Key; var workItemStore = collection.GetService <WorkItemStore>(); var workItemTypesCollection = workItemStore.Projects[teamProjectName].WorkItemTypes; var workItemTypes = workItemTypesCollection.Cast <WorkItemType>().Select(x => x.Name).ToArray(); return(workItemTypes); }
public static string[] GetWorkItemTypesForProject(TfsPluginProfile settings) { if (settings.ProjectsMapping == null || settings.ProjectsMapping.Count == 0) return null; var parameters = GetTfsConnectionParameters(settings); var collection = new TfsTeamProjectCollection(parameters.TfsCollectionUri, parameters.Credential); string teamProjectName = settings.ProjectsMapping[0].Key; var workItemStore = collection.GetService<WorkItemStore>(); var workItemTypesCollection = workItemStore.Projects[teamProjectName].WorkItemTypes; var workItemTypes = workItemTypesCollection.Cast<WorkItemType>().Select(x => x.Name).ToArray(); return workItemTypes; }