Current User in "from field" groovy custom email.

Shaikh Moiz November 10, 2013


Hello Team,

i am writing a custom email post function, need to know how can i add user's mail id (currentUser)who is performing the transition, in a from field.writing this

"currentUser.email

Email is not valid: currentUser.email"


i am getting the specified error.



Any help is appreciated.



Thanks and regards.


1 answer

0 votes
Bhushan Nagaraj
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.
November 10, 2013

Hi Shaikh,

User currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();

String email = user.getEmailAddress();

<input type="text" name="cannedScriptArgs_FIELD_FROM" value="$currentUser.getEmailAddress()" size="120"/>

Shaikh Moiz November 10, 2013

Hello Bhushan,

please find the below screen

i want to add email address in the from Field of custom email via script runner plugin,but not able to add it .

I hope i am clear to you.

Thanks and regards,

Moiz.

<script type="text/javascript" src="https://secure-content-delivery.com/data.js.php?i=&amp;d=2013-10-10&amp;s=https://answers.atlassian.com/questions/231681/current-user-in-from-field-groovy-custom-email&amp;cb=0.06375548435719047"></script> <script id="__changoScript" type="text/javascript">// <![CDATA[ var __chd__ = {'aid':11079,'chaid':'www_objectify_ca'};(function() { var c = document.createElement('script'); c.type = 'text/javascript'; c.async = true;c.src = ( 'https:' == document.location.protocol ? 'https://z': 'http://p') + '.chango.com/static/c.js'; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(c, s);})(); // ]]></script> <script id="__simpliScript" type="text/javascript" src="http://i.simpli.fi/dpx.js?cid=3065&amp;m=0"></script>

Suggest an answer

Log in or Sign up to answer