Send JSM Forms information with automation - Send email action

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

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.

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:

ライセンスを付与済みのユーザー

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.

顧客アカウント

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 Create and attach a PDF of the form to the issue 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:

Click here to see all the steps to create the automation rule

First, ensure that the option Create and attach a PDF of the form to the issue 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 Create and attach a PDF of the form to the issueSave 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>

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)}}

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:
    • 報告者
    • リクエスト参加者
    • 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

Click here to see all the steps to create 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 Jira fields to them

Second alternative:

We also have a workaround to fetch information from the form into a JSON. You can find the steps for it in the community article below:

Click here to see all the steps to create 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:

JSDCLOUD-11195 - Getting issue details... STATUS




最終更新日 2024 年 4 月 1 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.