Send JSM Forms information with automation

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

Summary

Currently, it's not possible to send the form in a Jira notification. However, we can use an automation rule to send the email using the Send Email action.

Send Forms for licensed users or customers

There are different ways to send the form information in the notification that will be sent through the automation rule and it will depend if the user is a licensed user or a customer account:

Licensed users

For licensed users with internal access to the project, we can use the workaround described in the following document:

Please note that the smart value used in the above workaround uses our REST API to send the Attachment, so it is necessary to have internal permissions and authentication to use it. In other words, it sends the API URL of the attachment, hence only licensed users will be able to use the link and download the attachment.

Customer accounts

For customer accounts, we can also send the PDF of the form to the customer but with different and additional steps compared to the licensed users. The following knowledge base article contains the steps to send attachments to customers using the automation rule:

As mentioned in the document, to work as expected, the attachment should be visible to the user through a public comment in the request. Thus, it's important to note that, when a form is added to a request and the option Save a PDF version of this form each time it's resubmitted is enabled in the Form settings, the form is saved internally as an attachment file on the ticket, meaning it's not saved in a comment. Thus, to workaround this limitation, we can add an automation action to add a comment(public) with the attachments added to the ticket.

The automation rule will look similar to the one shown in the screenshot below:

Automation rule details for sending an email. When any form is submitted, add a comment to the issue with the attachment's file name. Create smart values for the request attachment and issue ID. Send an email to the reporter using the issue key.  Option to add another component to the automation rule is available.

First, ensure that the option Save a PDF version of this form each time it's resubmitted is enabled under forms settings:

  • Open the service project > Project settings > Forms > Open the desired form and go to Settings tab > Enable the toggle next to Save a PDF version of this form each time it's resubmittedSave changes.

Then, to create the automation rule:

1. Open the service project > Project settings > Automation > Create rule.
2. As a trigger, select Forms submitted and, if necessary, the desired form > Save.
3. Select New action > Comment on issue > Add the following smart value:

{{#attachment}}
[^{{filename}}]
{{/}}

4. In the Comment visibility, select Share with customer > Save.

5. Select New action > Create a variable (e.g., {{requestattach}}) with the following structure:

<ul> 
    {{#issue.attachment}} 
    <li>
        <a href="{{content.replaceAll("(.*)(rest\/api\/2\/.*\/)(\d{5,})","$1servicedesk/customershim/secure/attachment/$3/")}}{{filename}}?fromIssue=replaceme">{{filename}}</a>
    </li> 
    {{/issue.attachment}} 
</ul>

Automation rule configuration in Jira. The rule is triggered when any form is submitted. It adds a comment to the issue with attachment details, creates variables for the request attachment and issue ID, and sends an email to the reporter of the form submission. A Create Variable action is highlighted, showing the variable name as requestattach and the smart value as an HTML unordered list displaying issue attachments.

6. Click on Save > New action > Create a variable (e.g., {{issueId}}) with the following structure:

{{issue.id}}

7. Click on Save > New action > Send email > Enter the desired information in the To and Subject field. In the Content, add the desired information and call the variable with the following function to replace the replaceme text with the second variable issued:

{{requestattach.replace("replaceme",issueId)}}

Jira automation rule configuration for sending an email. The rule is triggered by any form submission.  It adds a comment to the issue, creates variables for attachments and issue ID, and then sends an email to the reporter. The email subject is set to the issue key, and the content uses smart values, including replacing a placeholder with the issue ID. The Send email action configuration is displayed.

Customers must see the respective attachments on the request on the Portal to open the attachment links. This means:

  • The customer must be authenticated in the Portal.
  • They also must be able to see the request where the attachment pertains to on the Portal by being:
    • Reporter.
    • Request Participant.
    • Member of an Organization the ticket is being shared with.

  • If you identify a "Comment body can not be empty!" error during rule execution, add a "Re-fetch issue data" action after the initial trigger.
  • Last but not least, the attachment should be visible to the customer through a comment in the request.

Licensed users and Customer accounts

We can also send form information using smart values:

First alternative:

We can link the form field to a Jira field and use the Jira field in the automation rule:

  1. Link the form fields to the Jira fields.

  2. Then, create the automation rule and add the smart values associated with these Jira fields to the Content (under Send email action in the automation). More details on how to find the smart values can be found in this document: Jira smart values - issues.

    1. 1. Open the project > Project settings > Automation > Select Create rule.
      2.
      Select the desired triggerSave.
      3. Select New action > Send email > In To, type the email address you want to send the notification, a user picker field, or a group.
      4. Fill in a Subject and Content and add the smart values associated with Jira fields to them.

Second alternative:

We can also use Forms smart values in the automation rule:

1. Open the project > Project settings > Automation > Select Create rule.
2.
Select the desired triggerSave.
3. Select New action > Send email > In To, type the email address you want to send the notification, a user picker field, or a group.
4. Fill in a Subject and Content and add the smart values associated with Form fields to them.

Also, please note that we have a feature request asking for the ability to send form information in the notifications, as we can see below:



Last modified on Feb 6, 2025

Was this helpful?

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