Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

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

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???


2 answers

0 votes
Ravi Sagar Community Leader May 20, 2021

Hi @Tom Hudgins 

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

I hope it helps.


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?

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)?

Suggest an answer

Log in or Sign up to answer

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