How to add email addresses in SendCustomEmail

Hello everyone!
I'm using script runner and "Send a custom email" listener.I want to add (automatically) emails in "" field.
I think, the solution is to use custom groovy script which can call this listener and add emails in that field.
I have some questions:
How can I call this listener? and How can I add emails in that field?

Sorry for my bad language.
Any help would be greatly appreciated!

2 answers

1 accepted

1 vote

If you want to dynamically change the recipients, you should send it to the value of a user or multiuser custom field, and you set the value of that to a user or list of users.

So "To Addresses" is for email addresses, "To Fields" is for using fields to govern the recipients.

Hi Jamie, thanks for the answer. Can you provide some guidance how to do it better? I tried to get watchers: watcherManager.getCurrentWatcherUsernames(issue); and then get email addresses via watcherUser.getEmailAddress(); It works, but it only a half of work:) How can I add these email addresses? Explain me please. I also tried to create some custom groovy for sending email: Email email = new Email(emailTo); email.setSubject(subject); email.setBody(content); mailServer.send(email); But I don't know how to add files like your "Send a custom email" listener.

I understood all. thank you. Solved.

or I need a custom listener with the same functions: add attachments and html format.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

Mission-critical battery manufacturer fulfills FAA software requirements with Commit Policy Plugin

EaglePicher Technologies is a leading manufacturer of battery systems for diverse industries like defense, aviation, space or medical. As they operate in highly regulated industries, keeping a clear ...

165 views 0 2
Read article

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