Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Getting user login Edited

Hey guys, i'm trying to get user login on JIRA using ScriptRunner like:

def jiraUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();

but the return is XXXXXX(xxxxxx) and all i want is XXXXXX.

So, how can i get only the XXXXXX?

 

OBS: def jiraUser = ComponentAccessor.getJiraAuthenticationContext().getName(); returns XXXXXX(xxxxxx) to.

OBS2: I don't want to user replace things to remove (xxxxxx), it need to be something simple.

1 answer

1 accepted

0 votes
Answer accepted

You can use .displayName 

or whatever options are here https://docs.atlassian.com/software/jira/docs/api/8.5.4/

 

You can always add .class at the end to see what to look up in the docs.

.displayName didn't work for me, but i will search on documentation.

EDIT: 

def jiraUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser().getName(); worked perfectly.  I just added .getName();

Thanks!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you