It's all about the answers!

Ask a question

How to get project area name via IWorkItem


Anthony Krowiak (1111612) | asked Jun 13 '11, 11:15 a.m.
If I have a reference to an IWorkItem object, how do I get the name of the project area in which the work item is defined?

2 answers



permanent link
Megan Katysovas (7665) | answered Jun 13 '11, 2:50 p.m.
This should work -

IProjectAreaHandle projectAreaHandle = workItem.getProjectArea();

IProjectArea projectArea = (IProjectArea) repo.itemManager().fetchCompleteItem(projectAreaHandle, IItemManager.DEFAULT, monitor);

String projectAreaName = projectArea.getName();

permanent link
Anthony Krowiak (1111612) | answered Jun 14 '11, 10:28 a.m.
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.

Your answer


Register or to post your answer.