Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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??

0 votes


Accepted answer

Permanent link

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

0 votes

Comments

You should not use IWorkitemServer unless you work on a server extension. This class is not availabl ein the client API.  

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

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 18

Question asked: Feb 15 '23, 6:22 a.m.

Question was seen: 631 times

Last updated: Feb 17 '23, 2:37 a.m.

Confirmation Cancel Confirm