在 post-function Jira 中获取 currentUser

Getting currentUser in post-function Jira

我有下面这行代码

String currentUser = ((WorkflowContext)transientVars.get("context")).getCaller();

然后我继续打电话

(comment != "") && commentManager.create(parent, currentUser, comment, true);

我的问题是,CommentManager 现在需要 applicationUser 对象而不是 String。那么我如何获得 currentUser 将 return applicationUser.

Question on Atlassian board

ComponentAccessor.userManager.getUserByName(userName) 将为您提供用户名字符串的 ApplicationUser