It's all about the answers!

Ask a question

How to get the list of Categories (Filed Against) for an workitem via API


EclipseTalk . (32735959) | asked Jan 07 '15, 3:18 p.m.
edited Jan 08 '15, 8:23 a.m. by Ralph Schoon (61.5k33643)
Hello,
How to get the list of Categories (Filed Against) for an workitem via API
Thank you

Accepted answer


permanent link
sam detweiler (12.5k6189201) | answered Jan 08 '15, 7:29 a.m.
                // connect to category manager for this project area
                CategoriesManager catManager = CategoriesManager.createInstance(auditableClient, projectarea_handle, null);
                // get the root node
                CategoryTreeNode root = catManager.getRoot();
                // loop thru the roots children
                 for (CategoryTreeNode nodei : root.getChildren())
                 {
                    
                 }

note that this is a tree of categories, not a flat list..  so for each node, you need to check if there are children.

EclipseTalk . selected this answer as the correct answer

Your answer


Register or to post your answer.