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

Unable to get the logged in user details

Please check below code:

IContributor contributor = repo.contributorManager().fetchContributorByUserId(selectedUser, null); 
IProcessItemService service = (IProcessItemService) repo.getClientLibrary(IProcessItemService.class); 
IClientProcess clientProcess = service.getClientProcess(Teamarea, monitor); 
IRole[] availableRoles = clientProcess.getContributorRoles(contributor, Teamarea, null);

In the above code 
1. how to get the logged in user details (userid and user name) ??
2. How to create repo object ??

0 votes



One answer

Permanent link
See https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ and other articles there.

System.out.println("Logged in as: "
			+ teamRepository.loggedInContributor().getName());


0 votes

Comments

 Thank you Ralph Schoon for your quick response.


I am not able to create teamRepository object. Please help me how to create this object. FYI,I am using RTC server API but not RTC client API

Regards,
Mahesh

You don't crate it, you get it.

I would strongly recommend to read this post https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ it explains how to get the ITeamRepository from the TeamPlatform. You can also look into the links there and you can look into the snippets that come with the PlainJavaClientLibraries.

The same question came up some days ago and the same suggestion was made.

Alternatively you can read https://jazz.net/library/article/1229

  Thank you.


I am now getting below error:

ERROR: com.ibm.team.repository.common.NotLoggedInException: CRJAZ1244I Not logged in to the repository at URL "https://localhost:7443/jazz/". 

I am sorry, but if you don't follow the links suggested above and don't educate yourself e.g. by going to the Plain Java client Library snippets and trying to understand the basics of how this works, there is little forum members will be able to do to help you.


If you are not logged into the TeamRepository with a user, you can quite obviously not get the logged in user.

showing 5 of 6 show 1 more comments

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

Question asked: Aug 03 '15, 1:51 a.m.

Question was seen: 1,926 times

Last updated: Aug 05 '15, 4:46 a.m.

Confirmation Cancel Confirm