Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to get the categories of a given Team Area using RTC Plain Java API

Hello All,

I need to fetch all the categories of a given Team Area using RTC API. Currently am able to fetch the Team Areas from the Project Area.

Please help me in getting the categories of a TeamArea.


Thank you.

1

2 votes

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.



One answer

Permanent link

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);
    }


0 votes

Comments

Hello Kevin,. Thanks for your reply. This code is to get all the Categories for a given Project Area. But i need to get for the Specified Team Area.

Is there any way for getting the categories ?

The ICategory class has the method

getAssociatedTeamAreas() Returns the list of associated team areas.

So you'd have to get the complete list of categories anyway, then look for the specific team area.   Note that multiple categories can be mapped onto a single team.

Thanks a lot for your reply Kevin. you are mentioning about getting the Teamareas from the Categories.
But I need it in a reverse way. From the TeamAreas I need the categories associated with it.

Is there any APIs for getting this ?

Sometimes one has to create new tools from those already at hand.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954

Question asked: Oct 06 '17, 4:57 a.m.

Question was seen: 3,262 times

Last updated: Oct 10 '17, 2:48 p.m.

Confirmation Cancel Confirm