It's all about the answers!

Ask a question

How to get associated category for a team?


Avinash Bamane (20115) | asked Sep 23 '15, 5:45 a.m.
edited Sep 23 '15, 6:17 a.m.
Hello,
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



permanent link
Ralph Schoon (63.1k33645) | answered Sep 24 '15, 3:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
	/**
	 * 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
Avinash Bamane commented Sep 24 '15, 5:48 a.m.

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.


Ralph Schoon commented Sep 24 '15, 6:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.