Current User in "from field" groovy custom email.


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

Hi Shaikh,

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

String email = user.getEmailAddress();

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

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
Community showcase
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

456 views 7 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you