The method getLoggedInUser() is deprecated. ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
How can i get the logged in User object?
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);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use getUser which returns ApplicationUser object. This is to support the renaming of users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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());
}
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.