IRepositoryItemService.fetchItem()
![](http://jazz.net/_images/myphoto/c7ca34d39d96bb27076e61b55cf5a717.jpg)
for example:
IAttribute attrNew =ctx.getWorkItemServer().findAttribute(projArea, "XXX", null);
XXX is type of Contributor,
IContributor contNew = (IContributor)ctx.repositoryItemService.fetchItem(attrNew, null):null;
cause:com.ibm.team.workitem.common.internal.model.impl.AttributeImpl incompatible with com.ibm.team.repository.common.IContributor。
How do I handle IAttribute attrNew correctly to get the email address??
Accepted answer
![](http://jazz.net/_images/myphoto/c7ca34d39d96bb27076e61b55cf5a717.jpg)
The quality of the question is poor and there is no context about what this is all about. I would suggest you try to get better.
attrNew is a work item attribute for values that are of type contributor. Its type is IAttribute - as you can see. You can not cast it to IContributor.
You have to first get the value workitem.getValue(attrNew) of the attribute from the work item, which will be an IContributorHandle, which you have to then resolve/fetch to an IContributor to access details.
See: https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/ and other posts on that blog for details.