The method getLoggedInUser() is deprecated. ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
How can i get the logged in User object?
Use getUser which returns ApplicationUser object. This is to support the renaming of users.
My existing plugin has broken because I want User object to set as assignee for issue but i cannot set ApplicationUser object. Could you please let me know how to achieve this?
User user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(); try { issue.setAssignee(issue.getProjectObject().getLead()); }
The correct way to do this is to use
User user = ComponentAccessor.getJiraAuthenticationContext().getUser().getDirectoryUser();
More info in this article.
Try with the following code
try { User projectLead=issue.getProjectObject().getProjectLead().getDirectoryUser(); issue.setAssignee(projectLead); }
It looks like you're new here. Sign in or register to get started.