It's all about the answers!

Ask a question

Getting the UUID of the current user


Paul Klicnik (2633) | asked Oct 15 '10, 4:50 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
I'm looking for a way to get the UUID of the user currently signed in.

I know about the 'users' REST services (eg /ccm/whoami and /jts/users/{username}) but neither of those includes the internal UUID in the result. I read through the JFSUsersAPI wiki page (https://jazz.net/wiki/bin/view/Main/JFSUsersAPI) but that doesn't seem to have any info either.

Any ideas?

One answer



permanent link
Nick Edgar (6.5k711) | answered Oct 19 '10, 9:46 a.m.
JAZZ DEVELOPER
Are you trying to do this via the Java client API or via the web interfaces?
For the Java client API you can use:
com.ibm.team.repository.client.ITeamRepository.getUserId(),
com.ibm.team.repository.client.ITeamRepository.contributorManager() and
com.ibm.team.repository.client.IContributorManager.fetchContributorByUserId(String, IProgressMonitor)

The Jazz web UI uses, e.g.:
https://jazz.net/jazz/service/com.ibm.team.repository.service.internal.webuiInitializer.IWebUIInitializerRestService/initializationData

which contains a currentContributorInitializer section, e.g.:

"com.ibm.team.repository.service.currentContributorInitializer": {
"currentContributor": {
"_eQualifiedClassName": "com.ibm.team.repository:Contributor",
"archived": false,
"com.ibm.team.repository.typeName": "com.ibm.team.repository.Contributor",
"contextId": "_8lNyYNwSEd2pIJ5QVwgQGg",
"details": {
"_eQualifiedClassName": "com.ibm.team.repository:ContributorDetailsHandle",
"com.ibm.team.repository.typeName": "com.ibm.team.repository.ContributorDetails",
"itemId": "_7yhV8qjWEd-D1aqWcEbu6Q"
},
"emailAddress": "Nick_Edgar@ca.ibm.com",
"immutable": true,
"itemId": "_wzp-IPYJEdqU64Cr2VV0dQ",
"mergePredecessor": null,
"modified": "2010-09-14T15:56:54.072Z",
"modifiedBy": {
"_eQualifiedClassName": "com.ibm.team.repository:ContributorHandle",
"com.ibm.team.repository.typeName": "com.ibm.team.repository.Contributor",
"itemId": "_wzp-IPYJEdqU64Cr2VV0dQ"
},
"name": "Nick Edgar",
"predecessor": "_sUp4QcAYEd-fRr9iR3W1xg",
"stateId": "_seTjgcAYEd-fRr9iR3W1xg",
"userId": "nedgar"
},


Note that this is internal though.

As for pure JFS API, I'm not sure.

Your answer


Register or to post your answer.