It's all about the answers!

Ask a question

Listing archived categories using java client api?

Ajay Mallikarjunaiah (148410) | asked May 22 '14, 4:26 a.m.
edited May 22 '14, 4:27 a.m.
There are apis to list down all the categories for a given project area. But those apis wont list the archived categories. Is there any way to list all the categories for a given project area including the archived ones.
Any input(s) is/are  appreciated.
Thank you in advance.

One answer

permanent link
Ajay Mallikarjunaiah (148410) | answered May 22 '14, 5:51 a.m.
Hi Again,

Following method did it for me.

public void listAllCategories(String projectAreaName)
            throws TeamRepositoryException {
        //Project Area
        IProjectArea projectArea = getProjectArea(projectAreaName);
        //Auditable client
        IAuditableClient auditableClient = (IAuditableClient) repo
        //List of all existing categories. This will include all the visible, access restricted and archived categories.
        //In other words, every other category which was created.
        List<ICategoryHandle> allCategoryHandles = CategoriesHelper
                .findExistingCategories(auditableClient, projectArea, monitor);
        for (ICategoryHandle iCategoryHandle : allCategoryHandles) {

I'm printing only the itemId of ICategoryHandle. If you want to get the corresponding item. Please go through following link.

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.