IRepositoryItemService.fetchItem()
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
Ralph Schoon (63.6k●3●36●46)
| answered Feb 15 '23, 6:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Feb 15 '23, 6:44 a.m. 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.
Ralph Schoon selected this answer as the correct answer
Comments You should not use IWorkitemServer unless you work on a server extension. This class is not availabl ein the client API.
HuaXiao Jiang
commented Feb 16 '23, 7:43 p.m.
Ok, thank you, later the solution was found Then write an answer with the solution please, or accept the answer as a solution. |
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.