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 ?

3 answers

1 accepted

0 votes
Answer accepted

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!

0 votes

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?

0 votes
Susan Ostreicher Community Champion Oct 05, 2018

Hi @AKSHAY THAKARE, I'm sorry for the slow reply. From what I can tell, anyone with permission to view the request (e.g. a reporter or a request participant) can access that link. Have you seen that's not the case? 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page

                                                      &nbsp...

249 views 0 6
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