how to get creator and Owner info of Work item in Rational Team Concert 4.0.4 using plain java lib .The getOwner() method of IWorkItem returns IContributorHandle type object which don't have any method to get name from this. Please help.
IContributor
should be better suited.
See this thread:
Every handle class has a corresponding Item class where the 'full info' is available (handle is just some sort of pointer).
You can use the
IItemManager
(ITeamRepository#itemManager()
) to resolve a handle to an item (e.g. fromIContributorHandle
toIContributor
).
Something like this:
IContributorHandle wkspOwnerhandle = (IContributorHandle)data.getSourceWorkspace().getOwner();
IItem contributerHandle = itemService.fetchItem(wkspOwnerhandle, null);
IContributor userid = (IContributor) contributerHandle.getFullState();
String userName = userid.getName();