One can pull in a list of the categories something like:
IWorkItemClient service = getWorkItemClient();
List<ICategory> findCategories=null;
try {
findCategories = service.findCategories(
jazzServer.getProjectArea(), ICategory.FULL_PROFILE,
jazzServer.getMonitor());
} catch (TeamRepositoryException e) {
// TODO Auto-generated catch block
logger.error("Exception",e);
}
for (ICategory category : findCategories) {
// do something with the ICategory results
if (!category_cache.containsKey(category.getHierarchicalName())) {
logger.debug("Adding category name "+category.getHierarchicalName()+" to cache.");
category_cache.put(category.getHierarchicalName(), category);
}
}
private IWorkItemClient getWorkItemClient() {
return (IWorkItemClient) jazzServer.getRepository().getClientLibrary(
IWorkItemClient.class);
}
Comments
By "all categories of a given Team Area", do you mean all categories that are currently mapped to that team area? Note that the mapping can be different for different timelines, so you would need to ask "what categories are mapped to that team area in a specified timeline", or "in any timeline" (depending on what you want to use this information for). You might want to mention how you plan on using this information, in case there is a better way of addressing that use case.
Hello Geoffrey, Thanks for your reply.
We have a single timeline for all the Teams.
To elaborate on the usecase : I need to get the list of all the categories(its UUID) for the TeamAreas having a #notifyemail tag in the description.
So I am successfully able to read the Team's description(with #notifyemail tag). For this Teams I need to get the categories.
Is there any way I can get the categories ?
If by "categories of a team area", you mean the categories currently mapped to that team area, see Kevin's answer.