Francisco
Francisco

Reputation: 2228

Getting currentUser in post-function Jira

I have the following line of code

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

Then I proceed to call

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

My question is, that CommentManager now requires the applicationUser object instead of a String. So how do I get the currentUser that would return the applicationUser.

Question on Atlassian board

Upvotes: 0

Views: 837

Answers (1)

Vampire
Vampire

Reputation: 38734

ComponentAccessor.userManager.getUserByName(userName) will give you the ApplicationUser for a username string.

Upvotes: 1

Related Questions