Programmatically Obtaining Work Item Type Name
I've created a custom work item type and would like to programmatically obtain the work item type name from an IWorkItem. I've found that IWorkItem#getWorkItemType() returns a String containing the work item type ID, but I've been unable to find a method to obtain the work item type name. How do I obtain the work item type name?
Thanks,
Geoff Alexander
Thanks,
Geoff Alexander
One answer
Doing some further investigation, I found that the following code obtains the work item type name:
where workItemCommon is an instance of IWorkItemCommon, workItem is an instance of IWorkItem, and monitor is an instance of IProgressMonitor.
Geoff Alexander
String workItemTypeName = workItemCommon.findWorkItemType(workItem.getProjectArea(), workItem.getWorkItemType(), monitor ).getDisplayName();
where workItemCommon is an instance of IWorkItemCommon, workItem is an instance of IWorkItem, and monitor is an instance of IProgressMonitor.
Geoff Alexander