You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
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.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.