Support for renamed users (JIRA 6.0+)

Issue #18 new
DI2E Licensing created an issue

/src/main/java/com/atlassian/labs/jira/threadedcomments/rest/HandleComments.java uses the old JIRA api for getLoggedInUser(). This API call does not handle renamed AD users well. I believe this should be updated to use the latest API, possibly getUser().getDirectoryUser().

I tried to a simple replace, but that didn't do the trick:

56c56
<         final User loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
---
>         final User loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getUser().getDirectoryUser();
97c97
<                 ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser().getName(),
---
>                 ComponentAccessor.getJiraAuthenticationContext().getUser().getDirectoryUser().getName(),
128c128
<         final User loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
---
>         final User loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getUser().getDirectoryUser();
199c199
<         final User loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
---
>         final User loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getUser().getDirectoryUser();

Could someone please produce a patch that uses the correct, latest API calls that handle renamed users?

Comments (1)

  1. Horst Krause

    I think we faced this problem, too. We renamed our users (removed the "(at)company.tld" from the usernames for further LDAP integration. Now (still without LDAP) standard comments are fine, but the replies to comments just show the username instead of the realname and user avatar. Also the user gets a mail about his own reply (if already watching issue or being assigned), because jira seem to think the comment comes from somebody else.

  2. Log in to comment