It's all about the answers!

Ask a question

Programmatically Obtaining Work Item Type Name


1
1
Geoff Alexander (19623948) | asked Jul 12 '10, 3:30 p.m.
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

One answer



permanent link
Geoff Alexander (19623948) | answered Jul 12 '10, 4:11 p.m.
Doing some further investigation, I found that the following code obtains the work item type name:

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

Your answer


Register or to post 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.