user preforming transition in scripted Post Function

Mikkel Kragelund Nielsen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2013

Hey

Im using Script runner to run a Groovy Script as a Post Function.
But I cant figure out how to get data regarding the user preforming the transition.

Anyone know the property to get for the user (Like "issue" gets the current issue.)

3 answers

1 accepted

1 vote
Answer accepted
Henning Tietgens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2013

You can use componentManager.jiraAuthenticationContext.getLoggedInUser() to get the current user.

0 votes
Mikkel Kragelund Nielsen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2013

Found that this works:

User currentUser = UserUtils.getUser(((WorkflowContext) transientVars.get("context")).getCaller())

0 votes
Mikkel Kragelund Nielsen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2013

Tried:

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

But this "only" gets me the user name. I need the user Object (com.atlassian.crowd.embedded.api.User)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events