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

How to get username out of it's UUID ?

Hello,
I'm writing a plugin.
I have the UUID of a user ( UUID wkspOwnerID = data.getSourceWorkspace().getOwner().getItemId(); )
, but I don't know how to get the username.
How can I do it?
Thanks.

0 votes



5 answers

Permanent link
If you're writing a client plugin, check out com.ibm.team.repository.client.IContributorManager. It looks like getting the user via UUID might be a pain, but if you can use a userId instead, that would be easier.

0 votes


Permanent link


the contributormanager is correct.

in the javadoc here is the api
fetchContributorRecordByIdentity(IContributorIdentity identity,

which returns the contributor record from the identity, which is a UUID

IContributorRecord.getName(); will return the name.


and the javadoc is in the download section

Sam

0 votes


Permanent link

For what I know you can obtain every object (like object handle) by UUID using Object.ITEM_TYPE.createItemHandle method.

for example: (IChangeSetHandle)IChangeSet.ITEM_TYPE.createItemHandle(uuid, null);

0 votes


Permanent link
HI,

I tried but did't make it.

I'm using server side plugin and need to have the username/userid on  deliver action.

I thought I will make it like this:
String wkspOwner = data.getSourceWorkspace().getOwner().toString();
but it doesn't give the userid.

How can I get the userid out of the user UUID or how can I get the userid on deliver action (server side).

Need your assistance,
Yehiel

0 votes


Permanent link
 HI I got the data:
/*********get user name*************************
IContributorHandle wkspOwnerhandle = (IContributorHandle) data.getSourceWorkspace().getOwner();   
IItem contributerHandle = itemService.fetchItem(wkspOwnerhandle, null);
IContributor userid = (IContributor) contributerHandle.getFullState();
String userName = userid.getName();
I did't use UUID but I got the userid of the wkspace owner on deliver operation - server side.
Regards,
Yehiel

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,930

Question asked: Sep 11 '12, 2:40 p.m.

Question was seen: 6,797 times

Last updated: Oct 15 '12, 2:33 p.m.

Confirmation Cancel Confirm