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

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
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,227 views 5 10
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