How to acess email id and user name of users in RTC using server side api or script
Hello Everyone,
I am using RTC 606.1
I have to access user name and email id of users using server side api or with scripts.
Is it possible to access and update email id and user name of user in customer attributes.
Kindly provide me the api to access username and email id of users.
Thanks in advanced
Pallavi Deore
2 answers
There is no supported JavaScript API for that.
In the Java APIs you get the com.ibm.team.repository.common.IContributor interface and can access that information. Usually you use the com.ibm.team.repository.client.IContributorManager to locate the user, or you get a IContributorHandle and resolve that. The IContributorManager can be accessed from the ITeamRepository object in the client API.
There are some examples here: https://rsjazz.wordpress.com/?s=IContributor&submit=Search
There are several ways to do this, but are you looking for the details of all users or just the current logged in user?
For the current logged in user you can use the following:
dojo.require("com.ibm.team.repository.web.client.session.Session");
...
var loggedInUser = com.ibm.team.repository.web.client.session.getAuthenticatedContributor();
var loggedInUser = com.ibm.team.repository.web.client.session.getAuthenticatedContributor();
...
This will return an object containing details of the currently logged in user. There are also several other methods on the com.ibm.team.repository.web.client.session object that return subsets of this information.
For all users, you need to use the OSLC API for the application and project area you're working with - you have to be very careful with filtering so that you don't cause performance problems.