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

How to get creator Id using plain Java api?

Hi I am trying to get creator ID from workItem .
When i use the method
WorkItem.getCreator() I get the following message

com.ibm.team.repository.common.model.impl.ContributorHandleImpl@262b2
62b (stateId: <unset>, itemId: [UUID _noTKsbToEeCJhYt-X0WSYQ], origin: com.ibm.t
eam.repository.client.internal.TeamRepository@20772077, immutable: true)


Please suggest me how i can pull the creator name or email Address from the work Item.

Any suggestions are welcome

Thanks
Kishan

0 votes


Accepted answer

Permanent link
you need to convert the handle into a IContributor object

 IContributor User = (IContributor) teamRepository.itemManager().fetchCompleteItem(
                                                               IContributorHandle, IItemManager.DEFAULT. monitor);

print user.getName();
kishan adhi selected this answer as the correct answer

3 votes

Comments

Thanks Sam it worked G8


One other answer

Permanent link
Thanks Sam, it worked for me too. I fixed punctuation a little ;)
IContributorHandle creator = attachment.getCreator();
IProgressMonitor monitor = new SysoutProgressMonitor();
IContributor user = (IContributor) teamRepository.itemManager()
.fetchCompleteItem(creator, IItemManager.DEFAULT, monitor);
logger.info("WorkItem attachment creator: " + user.getName());

0 votes

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,948
× 169
× 9

Question asked: May 09 '13, 4:03 p.m.

Question was seen: 7,387 times

Last updated: May 28 '18, 6:06 a.m.

Confirmation Cancel Confirm