Hey guys,
Is there a way to get the username of an application User that was mentioned on a ticket. def HowCanI = com.atlassian.jira.event.listeners.mention.MentionEventListener.getUsername()Or this there a way to search via full name to get a user userManager.getUserByName("Thomas Smith") -> The username is tsmith
you are mistaking listener with the event. MentionIssueCommentEvent has getToUsers() method which will return you set of ApplicationUsers:
https://docs.atlassian.com/software/jira/docs/api/7.6.4/com/atlassian/jira/event/issue/MentionIssueCommentEvent.html
as for your second question, there's
UserSearchService.findUsersByFullName(String fullName)
https://docs.atlassian.com/software/jira/docs/api/7.6.4/com/atlassian/jira/bc/user/search/UserSearchService.html
Hi Thomas, if you have access to the comment data. Usually, the username is already there and it is currently formatted as [~username]
All you need to do is parse that to whatever you like.
Hey thanks for that, was super helpful!
Hey Bryan, this is what I ended up doing, just filtered out the [~] and I had the username
It looks like you're new here. Sign in or register to get started.