How to send JSM form PDFs as an email attachment to specific users using automation

Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

Summary

Automation for Jira has an action called Attach forms. This action allows you to attach the PDF of one or more forms submitted via the customer portal/create new issue link to an issue. However, in case you want to use a Send email  action in your automation rule to email this form as an attachment to specific users, it is not possible to do so as the form does not get added as an attachment to the email that is sent out.

Using this alternative, Jira Service Management Forms are accessible to download only for Internal Licensed Users and NOT for Portal-Only Customer accounts and hence any email sent to portal-only customers will not be able to download the form.

For portal-only accounts, the workaround is described in the document below:

Solution

First, we need to ensure that the field is not hidden in the Field Configurations and is configured to the View Issue Screen for the required Issue Type.

Then, we need to ensure that on form submission, a PDF is created. Kindly follow these steps:

  1. In your service project, go to Project Settings > Forms.
  2. Click on the form which you want to use.
  3. Go to the Settings tab.
  4. Under Preferences , enable the toggle next to Save a PDF version of this form each time it's resubmitted.
  5. Click on Save Changes.

Secondly, we will add a piece of code in the Send email action which will create a hyperlink in the email sent out. When the user clicks on the link in the email, the form will get downloaded.

The automation rule will be as follows: 

In the Attach forms action, please ensure to check the option as highlighted below:

Add the following code in the Content of the Send email action as is.

<ul>
{{#issue.attachment}}
{{#if(equals(mimeType, "application/pdf"))}}
<li><a href="{{content}}">{{filename}}</a></li>
{{/}}
{{/issue.attachment}}
</ul>

Note: This code block will include any/all PDF attachments that are currently on this issue/request.  However by checking the mimeType of the attachment, this method can at least avoid including any other attachment types to the request, such as images from email signatures and alike.

The hyperlink in the email received will look like follows:




Last modified on Jul 18, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.