How to get project area name via IWorkItem
2 answers
This should work -
IProjectAreaHandle projectAreaHandle = workItem.getProjectArea();
IProjectArea projectArea = (IProjectArea) repo.itemManager().fetchCompleteItem(projectAreaHandle, IItemManager.DEFAULT, monitor);
String projectAreaName = projectArea.getName();
This should work -
IProjectAreaHandle projectAreaHandle = workItem.getProjectArea();
IProjectArea projectArea = (IProjectArea) repo.itemManager().fetchCompleteItem(projectAreaHandle, IItemManager.DEFAULT, monitor);
String projectAreaName = projectArea.getName();
The above will not work as my code is server-side only, however; it did lead me to the solution which is to retrieve the IRepositoryItemService service object and invoke the IRepositoryItemService.fetchItem(projectAreaHandle, IRepositoryItemServer.COMPLETE) method.