Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do you get more specific details from the object returned by getLoggedInUser()?

Alexis Evans
Contributor
July 29, 2022

I am using the getLoggedInUser() method and saving the object it returns to a variable. However, instead, I want to specifically get the name of the logged in user, as opposed to the entire object. Is there a way to see the entire logged in user object listed out, or specifically pull bits of information from it? A hypothetical example might be getLoggedInUser().name to pull the name.

1 answer

1 accepted

0 votes
Answer accepted
Mohamed Benziane
Community Champion
July 30, 2022

Hi,

Welcome to the community.

When you use getloggedinuser() you get an ApplicationUser object so you can use some methode from this class

https://docs.atlassian.com/software/jira/docs/api/7.0.6/com/atlassian/jira/user/ApplicationUser.html

Alexis Evans
Contributor
August 1, 2022

Oh awesome, thanks so much! It looks like it includes the getName() method so that should work for what I'm looking for. It would probably be getLoggedInUser().getName() correct?

Like Mohamed Benziane likes this
Mohamed Benziane
Community Champion
August 1, 2022

Yes getLoggedInUser() will give you the user's username.

Like Alexis Evans likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events