How do I add attachments to an e-mail with Automation for JIRA

Andreas Knecht Community Champion Mar 06, 2017

Is it possible to add attachments to an e-mail with Automation for JIRA ?

2 answers

1 accepted

This widget could not be displayed.

So you can't embed attachments directly in an e-mail (we don't support this due to the fact that attachments in JIRA could be far to large for emails), but you can add links using smart fields.

Here's an example rule:

Project automation - Code Barrel JIRA 2017-03-07 11-12-49.png

So this email body will iterate over all attachments on an issue and produce links that allow recipients to download the attachment directly from JIRA: 

Hi there,


Attachments:
<ul>
{{#issue.attachment}}
<li><a href="{{content}}">{{filename}}</a></li>
{{/issue.attachment}}
</ul>

Cheers,
  Auto
Susan Ostreicher Community Champion Oct 19, 2017

Hello @Andreas Knecht - can this code be adapted to add a comment (instead of an email) with links to all attachments?  Thanks!

This widget could not be displayed.

For anyone else who comes across this... I had trouble with the code above, but this seemed to work for me: 

Attachments:
<a href="https://example.com/jira/secure/attachment/{{issue.fields.attachment.id}}/{{issue.fields.attachment.filename}}">{{issue.fields.attachment.filename}}</a>

Hi, @Susan Ostreicher only administrator of Jira can access this link, so what about other users?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

509 views 3 18
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