Allow user to send email with attachment(s) from issue

Tom Hudgins May 20, 2021

I have a Jira project with issues that have PDF attachments. The initial request was to provide a way for users to "click a button" to send an email to a user list, maintained in a separate field, that includes the attachment. I solved that with a manually triggered automation rule that fired a custom event and a Scriptrunner listener that hears that event and grabs the attachment (who's filename ends in '.pdf') and sends it. Works fine.

Now they want to allow the user to select from potentially multiple attachments in the ticket and send those and I'm not sure how (best) to solve this.

I can use a Scriptrunner fragment button to pop-up a dialog that will list the attachments (I think) and allow the user to select the one(s) they want to send but I'm not sure how to pass that info to the listener. The reason I'm using the listener is I don't know of any other way to send mail with attachments. I can send html emails through a standard script but I don't see a way to include attachments. If there is a way to do that in a groovy script that would be best.

Failing that, is there a way to send a payload in an event such that my listener could determine which files were selected? The only solution I can think of is to save the list of selected files in a hidden field and then have the listener look at that. 

Maybe I'm blinded by my first solution and there's an easier way for all of this???

Thanks

2 answers

0 votes
Boris Berenberg - Atlas Authority
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.
May 23, 2021

We support this in the Send Email from Issue functionality in Notification Assistant for Jira

Tom Hudgins May 24, 2021

Am I reading the docs correctly in that to send an attachment I have to choose it from my local drive (not pick from the documents already attached to the issue)?

0 votes
Ravi Sagar _Sparxsys_
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.
May 20, 2021

Hi @Tom Hudgins 

You are very close. You need to create a custom REST end point.

I hope it helps.

Ravi

Tom Hudgins May 20, 2021

I know how to create a custom REST Endpoint. That's how I would pop up the dialog to list the files. How does that help in sending the email with attachments?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.16.0
TAGS
AUG Leaders

Atlassian Community Events