IContributorHandle to IContributor
![](http://jazz.net/_images/myphoto/9edb570312123cbea59cc2b2c83cb7e6.jpg)
Hi,
I tried several ways to find a client that will give me IContributor from an IContributorHandle. I tried different clients(e.g. IWorkItemClient, IProcessClientService) using getClientLibrary() the function.
It would be very helpful if someone can let me know which cilent interface to use to achieve it.
Thanks.
Regards,
Abhishek
I tried several ways to find a client that will give me IContributor from an IContributorHandle. I tried different clients(e.g. IWorkItemClient, IProcessClientService) using getClientLibrary() the function.
It would be very helpful if someone can let me know which cilent interface to use to achieve it.
Thanks.
Regards,
Abhishek
Accepted answer
![](http://jazz.net/_images/myphoto/9edb570312123cbea59cc2b2c83cb7e6.jpg)
Hi
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. from IContributorHandle to IContributor).
Regards
Marcel
Jazz Work Item team
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. from IContributorHandle to IContributor).
Regards
Marcel
Jazz Work Item team
One other answer
![](http://jazz.net/_images/myphoto/9edb570312123cbea59cc2b2c83cb7e6.jpg)
Example code:
IProgressMonitor monitor = new SysoutProgressMonitor();
repo = login(monitor);
System.out.println("Admin: " + repo.contributorManager().fetchContributorByUserId("admin", monitor).getDetails().toString());
ILicenseAdminService licAdminService = (ILicenseAdminService) ((TeamRepository) repo).getServiceInterface(ILicenseAdminService.class);
List<IContributorLicenseType> lList = new ArrayList<IContributorLicenseType>(Arrays.asList(licAdminService.getLicenseTypes()));
for (Iterator<IContributorLicenseType> itContributor = lList.iterator(); itContributor.hasNext();) {
IContributorLicenseType iLT = itContributor.next();
System.out.println("Nome: " + iLT.getName() + ", " + iLT.getId() + " " + lList.size());
IContributorHandle[] iCH = licAdminService.getLicensedContributors(iLT.getId());
for (int i = 0; i < iCH.length; i++) {
IContributor contributor = (IContributor) repo.itemManager().fetchCompleteItem(iCH[i], IItemManager.DEFAULT, monitor);
System.out.println("User name: " + contributor.getName());
}
}
Comments
![](http://jazz.net/_images/myphoto/e5e63d5878217b64611c1df9401b7cd3.jpg)
A lot of those basic quastions are answered in this post: https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ and in other posts on that blog.