Property 'currentUser' not found in custom email?

Martin Heinemann June 21, 2015

Hi,

im getting the error message "Property 'currentUser' not found" in the create issue screen after i press the "Create Issue" button.

i added a post function "Send custom email" from the script runner plugin.

While the preview action in the editor sais everything is ok, the real execution of the script in the workflow shows the error "Propery 'currentUser' not found". But the issue is created succesfully.

I am accessing the currentUser in that way:

bla blubb ${currentUser.displayName} more text for the email

 

This is the order of the post functions

image2015-6-22 10:40:36.png

Where is my error?

 

 

2 answers

1 accepted

0 votes
Answer accepted
Martin Heinemann June 21, 2015

Well, i can solve this by my self:

in script runner, the currentUser is not an object but a function.

So the correct syntax is:

$currentUser.displayName

 

 

0 votes
JamieA
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.
June 21, 2015

I'm a bit confused... I don't see currentUser as being available in the script binding there. I was going to suggest using:

componentManager.jiraAuthenticationContext?.user?.displayName

Suggest an answer

Log in or Sign up to answer