It's all about the answers!

Ask a question

How to check if the user exists in RTC ?


Shwetha G (60331) | asked Apr 28 '17, 7:18 a.m.
edited Apr 28 '17, 7:43 a.m.

Hello All,

We have a usecase wherein we need to automate the user account creation.

As a part of first step. Given the userID, we need to check if the user has account in RTC.

Is there any OSLC/REST query to check this ? Or any other APIs to check the user existence ?


Request you to assist on this.

Thanks

2 answers



permanent link
Ralph Schoon (63.5k33646) | answered Apr 28 '17, 7:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Options for automation


  1. Repotools -exportUsers
  2. Repotools -importUsers
  3. Repotools -createUsers
  4. Java API https://rsjazz.wordpress.com/2013/01/08/maintaing-user-photos-with-the-plain-java-client-libraries/ and https://rsjazz.wordpress.com/2012/10/12/changing-the-jazz-user-id-using-the-rtc-plain-java-client-libraries/ show at least how to get the users and find them using an ID.


permanent link
Luca Martinucci (1.0k397112) | answered Apr 28 '17, 8:07 a.m.

Shwetha,
I use this code snippet from the server-side Java API to retrieve a user (contributor) with a given userid:

IContributorService contributorService = getService(IContributorService.class);
IContributorHandle contributorHandle = contributorService.fetchContributorByUserId(userid);         
IContributor contributor = (IContributor) repositoryItemService.fetchItem(contributorHandle, IRepositoryItemService.COMPLETE);


In order to check whether a user exists in RTC, you could check if contributorHandle is null.

Your answer


Register or 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.