How can I get the high level categories for an ICategory I have?
When I have an
|
One answer
Ralph Schoon (63.5k●3●36●46)
| answered Jun 20 '22, 2:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Methods to work with ICathegory are on com.ibm.team.workitem.common.IWorkItemCommon . The category resembles a path separated by /, so you would do string operations to get the higher hierarchy.
https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/ section Category shows calculateCategoryAsString.
This code does the reverse operation
private ICategoryHandle findCategory(String value) throws TeamRepositoryException { List<string> path = StringUtil.splitStringToList(value, PATH_SEPARATOR); ICategoryHandle category = getWorkItemCommon().findCategoryByNamePath(getWorkItem().getProjectArea(), path, monitor); if (category == null && value != null) { if (value.equals("Unassigned")) { // category=ICategory.DEFAULT_CATEGORY_PROPERTY; category = getWorkItemCommon().findUnassignedCategory(getWorkItem().getProjectArea(), ICategory.SMALL_PROFILE, monitor); } } return category; } </string> |
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.