It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Script Runner Send a custom email From email address set to reporter

Dan Porter May 14, 2013

Hi. I would like to use the send a custom email built in script in my transition and have it sent from the reporters email address so that the recipients can email the reporter in a reply versus sending back to a static email address. Is this possible? I tried putting issue.reporter.emailAddress in the field but it throws an error for not being a valid email address.

4 answers

1 accepted

1 vote
Answer accepted
JamieA May 14, 2013

Not possible atm - you can enter an RFE if you like: https://jamieechlin.atlassian.net/browse/GRV - or make the customisation yourself.

Dan Porter May 14, 2013

Could I create a script file and run that script on transition to do it? If so, is there a template I can use for the custom email script so I can just modify it myself to add the issue reporter as the From field? Or is there a way to see the script that I already generated using the Custom Email built in functionality?

Dan Porter May 14, 2013

Could I create a script file and run that script on transition to do it? If so, is there a template I can use for the custom email script so I can just modify it myself to add the issue reporter as the From field? Or is there a way to see the script that I already generated using the Custom Email built in functionality?

Dan Porter May 14, 2013

Could I create a script file and run that script on transition to do it? If so, is there a template I can use for the custom email script so I can just modify it myself to add the issue reporter as the From field? Or is there a way to see the script that I already generated using the Custom Email built in functionality?

Henning Tietgens May 15, 2013

If you select a built-in script there is a link to the source file on the page (in the colored box).

0 votes
Dan Porter May 14, 2013

Could I create a script file and run that script on transition to do it? If so, is there a template I can use for the custom email script so I can just modify it myself to add the issue reporter as the From field? Or is there a way to see the script that I already generated using the Custom Email built in functionality?

0 votes
Dan Porter May 15, 2013

See it now. Thanks!

0 votes
Bahar Dehkordi Jul 12, 2018

@Henning Tietgens, @Dan Porter1

 

I have the exact same issue, but can't seem to find the link to the source file. Can you please advise? Thanks! 

Henning Tietgens Jul 23, 2018

Hi, the source files are not directly linked anymore. You have to extract them from the plugin archive.

Bahar Dehkordi Jul 24, 2018 • edited

Hi Hennig, can you please explain how to do that? We are still on the free trial. Would it be possible for us to extract it? Thank you!

Bahar Dehkordi Jul 24, 2018

Hi Hennig, can you please explain how to do that? We are still on the free trial. Would it be possible for us to extract it? Thank you!

Bahar Dehkordi Jul 24, 2018

Hi @Henning Tietgens thanks for your reply. Can you please briefly explain how to do it? We are still on the trial. Is this option open to us?

Henning Tietgens Jul 24, 2018

Sure @Bahar Dehkordi, just download the plugin to your local computer from the plugin manager and extract the .jar file with a zip program. In the archive look into the directory com\onresolve\scriptrunner\canned\jira\workflow\postfunctions\ for the file SendCustomEmail.groovy to find the source.

BUT it seems that this is not necessary anymore with the current version, see https://scriptrunner.adaptavist.com/5.4.12/jira/builtin-scripts.html#_dynamic_control_over_recipients_and_from

Henning

Bahar Dehkordi Jul 27, 2018

Yes I had tried this "mail.setFrom("$issue.reporter")"  in the conditions and configuration before and it didn't work, but now works perfectly after the update! 

Thank you soo much :)

Bahar Dehkordi Aug 02, 2018 • edited

Wanted to add that "mail.setFrom("$issue.reporter")" did not work because it is not an email address. Used the below and worked!

mail.setFrom("$issue.reporter.emailAddress") mail.setReplyTo("$issue.reporter.emailAddress")

Like Вадим Пак likes this

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Opsgenie

Introducing Postmortems for Opsgenie

When incidents happen, it is crucial to diagnose and solve the problem as fast as possible. Equally important to this, teams need a way to reflect on why the incident occurred and how they can improv...

243 views 0 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you