List of all categories
One answer
Hi Robert,
the code to get the categories of a given project are looks as below:
If you have an arbitrary process area (project area/team area) this gives you the associated categories, as far as I can tell.
the code to get the categories of a given project are looks as below:
/** * Print the Categories for a given Project Area * * @param teamRepository * @param projectArea * @param monitor * @throws TeamRepositoryException */ private static void printProjectAreaCategories(ITeamRepository teamRepository, IProjectArea projectArea, IProgressMonitor monitor) throws TeamRepositoryException { IWorkItemClient workItemClient = (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class); Listcategories = workItemClient.findCategories(projectArea, ICategory.FULL_PROFILE, monitor); System.out.println("Categories of Project Area:"); for (ICategory iCategory : categories) { System.out.println("\tID:" + iCategory.getCategoryId() + "\tName" + iCategory.getName()); } }
If you have an arbitrary process area (project area/team area) this gives you the associated categories, as far as I can tell.
/** * Print the Categories for a given Process Area * * @param teamRepository * @param processArea * @param monitor * @throws TeamRepositoryException */ private static void printProcessAreaCategories(ITeamRepository teamRepository, IProcessArea processArea, IProgressMonitor monitor) throws TeamRepositoryException { IWorkItemClient workItemClient = (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class); Listcategories = workItemClient.findCategoriesOfProcessArea(processArea, ICategory.FULL_PROFILE, monitor); System.out.println("Categories of Process Area:"); for (ICategory iCategory : categories) { System.out.println("\tID:" + iCategory.getCategoryId() + "\tName" + iCategory.getName()); } }