Is it possible to add attachments to an e-mail with Automation for JIRA ?
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
Hello @andreas - can this code be adapted to add a comment (instead of an email) with links to all attachments? Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @andreas. We want to send the attachments to an external support user, but the link would require a JSD account. Is there any way around this now? Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @andreas , really Automation for Jira has been great to work with. We are slowly learning how to optimize our JIRA instance. In light of this question, I am having trouble adding the attachment link to an email. The caveat is that Im using another plugin for creating additional attachment custom fields.
Would you have a suggestion for how to deliver the link to the attachment in our custom field (customfield_17703). The reporter role would be the recipient of the email.
Any help would be greatly appreciated.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a way to do that with the Triggered Issue? I tried with this codes without luck any suggestions?
{{#triggerIssue.attachment}}
* [{{filename}}|{{content}}]
{{/}}
{{#triggerIssue.fields.attachment}}
* [{{filename}}|{{content}}]
{{/triggerIssue.fields.attachment}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So far I could not find a way to overcome the limitations to send the attachments to the external support user purely using Jira tools. Even exposing them to the portal is a bit tricky, they need to be inside a comment.
I ended up fashioning a PHP script to expose a REST endpoint that would ingest destination email list, the email body and the attachment details then compose and send such emails from the corporate email servers. In automation instead sending the email I am sending a request to that endpoint.
The PHP script itself logs in to Jira instance with an admin token hence it has access to all attachments it needs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The alternative is to use an app like Notification Assistant for Jira which supports sending attachments up to 20 MB in size.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @andreas
Is there any possibility to attach a particular attachment only in the email notification. Can you please confirm me once.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@andreas / All - Now that JIRA is allowing to download Email attachments directly from email notifications rather than logging into the portal, can you please hep advise how we can acheive the same via Automation - Send Email option please?
Reay appreciate all your support in this regard.
Regards,
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I still cannot work around that the link in question that is created from the smart values does not allow anyone other than admins to see the file. Is there a way we can open this to any customer or user in the tenant?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
{{#issue.attachment}}<li><a href="{{content}}">{{filename}}</a></li>{{/issue.attachment}}
This code displays a list of all attachments, how to get only the file that is added now? for example, by the trigger for changing the attachment field - display a comment only with the attachment added.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{{#issue.attachment.last}}<li><a href="{{content}}">{{filename}}</a></li>{{/issue.attachment.last}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
David, when I use the .last it pulls the last attachment in the list rather than the most recently added to the list.
Is there a way to get last by date?
Tnx
-Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matthew, when I used this, the attachments list (array) was populated internally chronologically, meaning the last one also was the most recent one. In case Atlassian has changed something there, you could also try '.first' instead of '.last'.
There is an ugly third possibility: If (like in the 'Approvers' array field) the order (index) of the attachments array elements keeps constantly changing, you would have to (only very quick summary) use the new automation feature (formerly Automation for Jira) to create a rule that
Hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there no way to attach a PDF to a email send from automation without adding it to the issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Benjamin Høegh Have you tried Better PDF Automation (free)? It can do just that as a companion app for Better PDF Exporter and it's available for both deployment types.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately still, the problem is not solved, that the accepted answer here only sends a link to a REST API endpoint in the email and users without (admin) account can not download the attachement.
Is there a solution for this by now?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use the lagacy automation. With the legacy automation you can also send the ticket description. In case the ticket description contains images etc, they are sent.
Best regards
Stephan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stephan,
what about comments with attachements?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, but in my case, this is not happening only admin can access that link even reporter also not able to view that attachment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.