Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

Retrieving mail id of a contributor using Java API from work item

Hi,

I want to retrieve mail id of a contributor using Java API from work item,

 i created one custom attribute type contributor, once work item created i want to retrieve mail id of that particular user.

Any suggestions

 

Thanks

Sachin Nairy

0 votes


Accepted answer

Permanent link
 Hi,
you can obtain this information from an IContributor object using getEmailAddress() method.

From a work item you only have to retrieve the contributor (I suppose from the author or the owner) as a IContributorHandle and then retrive the object using the IItemManager.

Best regards,
Michele. 
Sachin Nairy selected this answer as the correct answer

1 vote

Comments

Thanks Michele,

I am creating  server side plug-in, used below code to retrieve. But IItemManager & getEmailAddress is not resolving, Any specific package i have to import?

IContributorHandle createor = workItem.getCreator();

IItemManager mid = createor.getEmailAddress();

On server side you have to use IRepositoryItemService instead of IItemManager (which is used by plain api, not sdk).


IRepositoryItemService itemService = getService(IRepositoryItemService.class);
IContributorHandle creatorH = workItem.getCreator();
IContributor creator = (IContributor)itemService.fetchItem(creatorH,IRepositoryItemService.COMPLETE);
creator.getEmailAddress(); 

You have also to set IRepositoryItemService as prerequired service. Is not so simple if you have not develop other stuff on RTC server side. I suggest you to take a look to the SDK wiki page (the examples on follow-up and advisor creation).

Thanks a lot Michele, its working fine.

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
× 10,996

Question asked: Aug 29 '13, 3:43 a.m.

Question was seen: 5,810 times

Last updated: Aug 30 '13, 4:30 a.m.

Confirmation Cancel Confirm