How to get associated category for a team?
I am having team structure as follows,
Project Area
A
Team A
SubTeamA1
SubTeamA2
Team B
SubTeamB1
SubTeamB2
And categories are associated as follows,
Category Name Associate with
SubTeamA1 -> A/Team A/SubTeamA1
subTeamB1 -> A/Team B/SubTeamB1
Likewise there are number of teams at following after A. I am developing value set plugin.
Now, I want a list of all categories under A(Start with A/...). How to get this?
Thanks in advance.
One answer
/** * 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()); } }
Comments
Hello Raplh,
Thanks for reply!!
I am having 3 level team hierarchy and my category associations are with third level team. So associations look like this,(considering above mentioned hierarchy)
Category Name
SubTeamA1 -> A/Team A/SubTeamA1
When my category associations was with parent team like,
SubTeamA1-> Associates with A
I had used below mentioned function and it was working for me.
List<ICategory> list2= workItemCommon.findCategoriesOfTeamArea(parentTeamProcessArea, ICategory.FULL_PROFILE, monitor);
But now, associations are with third level team. And I want to get all categories start with ParentTeam/... for a particular selected Parent team.
Kindly revert for any concerns.
Thanks.
If you want to do this kind of stuff, I would suggest to enable yourself to do it.
Start here: Setting up Rational Team Concert for API Development follow it and do the workshop to setup your SDK. Follow Understanding and Using the RTC Java Client API
and use https://rsjazz.wordpress.com/2012/12/09/analyzing-a-aroject-areas-members-and-roles-using-the-plain-java-client-libraries/ to get the code above to work.