Getting the UUID of the current user
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?
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
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.:
Note that this is internal though.
As for pure JFS API, I'm not sure.
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.