It's all about the answers!

Ask a question

How can I list the categories in my project area and associated team?


Susan Hanson (1.6k2190193) | asked Jun 14 '13, 3:44 a.m.
I'm trying to find a way to get a list of the Categories defined in my project area and the team area associated to each category.  I have the IProjectArea, but didn't see any way to get the list of Categories (the Categories tab on the project area) and the team area that is associated to each.

Can someone help?
Susan

One answer



permanent link
Ralph Schoon (61.4k33643) | answered Jun 14 '13, 4:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Susan,

the code below shows how to do that. You can find the code here @ JazzHub:


	/**
	 * 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);
		List categories = 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()); 
		}	
	}

	/**
	 * 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);
		List categories = 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()); 
		}	
	}


Comments
kavita herur commented Mar 25 '14, 8:09 a.m.

Hi All,

 I am also looking for it. Is there shared query/report  so that it is easy to run?

 I created BIRT report to get team list, but  data from report which is fetched from COMMON snapshot doesnt match with project area data.

Your answer


Register or to post your answer.