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.
Community moderators have prevented the ability to post new answers.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.