Can I add a customfield value in the To field of an email?

Zaldy Parian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2023

Hi all,

I created an automation to email the assignee when their issue is at a certain status. The automation collects all issues and list them all as a tabular form in the body of the email.

We recently have users from outside of the company. As such, we create a customfield to store the email address of the external resource.

Is it possible to add the value of a customfield as receipient of an email?

I tried to include the customfield name in the To field, but it does not work.

email_customfield.png

 

1 answer

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2023

Hi Zaldy,

You should be able to do that if the custom field is a single user picker field. Try it as {{issue.customfield_10174}}

Zaldy Parian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 8, 2023

Thanks, John.

Testing this soon. The automation runs once every Tuesday morning (AEDT). And I cannot test run it right now as the email includes external email addresses.

I will update this as soon as the first run was triggered.

Cheers.

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 9, 2023

Since it is a Scheduled trigger - you can run it immediately to test if if you like. 

Zaldy Parian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 12, 2023

Hi John,

It didn't worked :-( 

The email was send to my own email despite of Assignee and {{issue.customfield_10174}} in the To field of the email.

Btw, the email has a table listing all included in the filter result.

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 12, 2023

Can you share the entire rule as you have it built?

Zaldy Parian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2023

Hi John,

Screenshot of the automation 

automation1.png

The "And: Send email" content is....

<b>*** This email is auto-generated from Jira. Do not reply to this email ***</b>
<br>
<br>
Follow up the review or approval of CR(s) assigned to your name to be included in TAB meeting this week. All approvals must be completed a day prior to TAB.
<br>
<br>

<html>
<head>
<style>
table, th, td {
border: 1.5px solid black;
border-collapse: collapse;
}

th {
background-color: #54585d;
color: #ffffff;
font-weight: bold;
font-size: 13px;
border: 1px solid #54585d;
}

</style>
</head>
<body>

<table>
<tbody>
<tr>
<th>Summary</th>
<th>Assignee</th>
<th>Change schedule</th>
<th>Status</th>
<th>Request type</th>
</tr>
{{#lookupIssues}}
<font size="-1">

<tr>
<td>&nbsp;&nbsp;{{summary}}&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;{{assignee.displayName}}
{{customfield_10174}}&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;{{customfield_10070.convertToTimeZone("Australia/Sydney").jqlDateTime}}&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;{{status.Name}}&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;{{customfield_10010}}&nbsp;&nbsp;</td>
</tr>

</font>
{{/}}
</tbody>
</table>

</body>
</html>

<br>
<br>

Zaldy Parian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2023

And btw, the recepients of the email; e.g., Assignee and {{issue.customfield_10174}} are not receiving the email. Instead, the email goes to my own Inbox.

I reckon I have to place the receipients of the email to a temporary buffer and use the that buffer in the To field of the email. I just don't know how to code it.  I also can use that buffer in the Assignee column in the table.

Like John Funk likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events