Display child value only from cascading custom field in email content in automation rule

Adrian Avalos
Contributor
May 29, 2024

Hello. I want to display the child value only from a cascading custom field in the email content of an automation rule that sends out emails. I tried adding "{{issue.customfield_1234.child.value}}" to email content but when the rule is triggered and email is sent out, that piece is empty. I also looked in the below to see if there was a smart value I could use but saw no mention of custom cascading fields. Any help would be greatly appreciated

 

Automation smart values - issues | Cloud automation Cloud | Atlassian Support

2 answers

1 accepted

4 votes
Answer accepted
Bill Sheboy
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.
May 29, 2024

Hi @Adrian Avalos 

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

If the field value and its child value are not empty, I would expect these two to work:

parent: {{issue.customfield_10105.value}}
child : {{issue.customfield_10105.child.value}}

Have you confirmed both are set?

Have you confirmed the custom field id is correct?

Kind regards,
Bill

Adrian Avalos
Contributor
May 30, 2024

Hi @Bill Sheboy 

Adding a bit more details this Automation rule only has three parts. The trigger set every 7 days, a jql lookup, and the send email piece posted below. The Audit Log displays as success when I hit run rule button. Email is also successfully received with everything displaying in cells in table except the output from my custom field 30732 which appears empty. Tried setting both and can confirm issues have something listed in that cascading field

 

Hello,

See below for a list of requirements in 'Submitted', 'Section Review', or 'Branch Review' Status for over 2 weeks <a href=https://maestro.dhs.gov/jira/issues/?filter=131819> or click here to access filter to see Issues</a>

<table style="border-collapse: collapse" table-layout="fixed" width="80%">

<tr>
<th style="border: 1px solid #000000; background-color : #CDCACA" valign="middle" halign="center">Key</th>

<th style="border: 1px solid #000000; background-color: #CDCACA" valign="middle" halign="center">Summary</th>

<th style="border: 1px solid #000000; background-color: #CDCACA" valign="middle" halign="center">Status</th>

<th style="border: 1px solid #000000; background-color: #CDCACA" valign="middle" halign="center">Assignee</th>

<th style="border: 1px solid #000000; background-color: #CDCACA" valign="middle" halign="center">Section</th>
</tr>

{{#lookupIssues}}
<tr>
<td style="border: 1px solid #000000" valign="middle" align="center"><a href="{{url}}">{{key}}</a></td>
<td style="border: 1px solid #000000" valign="middle" align="center">{{summary}}</td>
<td style="border: 1px solid #000000" valign="middle" align="center"> {{status.name}}</td>
<td style="border: 1px solid #000000" valign="middle" align="center"> {{assignee.displayName}}</td>
<td style="border: 1px solid #000000" valign="middle" align="center"> {{issue.customfield_30732.value}}</td>
<td style="border: 1px solid #000000" valign="middle" align="center"> {{issue.customfield_30732.child.value}}</td>
</tr>
{{/}}

</table>

 

Bill Sheboy
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.
May 30, 2024

First thing: when inside of an iterator such as {{#lookupIssues}}...{{/}} do not add the {{issue. prefix to the fields.  The scope is now the lookup and not the "current issue".  Please try removing that and re-test:

<td style="border: 1px solid #000000" valign="middle" align="center"> {{customfield_30732.value}}</td>
<td style="border: 1px solid #000000" valign="middle" align="center"> {{customfield_30732.child.value}}</td>

 

If that does not help...

Are you using Jira Cloud or Jira Data Center?  That is relevant because the Lookup Issues action for Jira Data Center does not yet support many fields, including custom fields.

Adrian Avalos
Contributor
May 30, 2024

Just attempted retested with {{issue. prefix removed like in your script and no luck. And I'm using Data Center

Bill Sheboy
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.
May 30, 2024

As noted, those fields are not available yet for Jira Data Center's version of Lookup Issues.  Here is the suggestion to add them: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877

 

There are two possible workarounds for this:

  • when you need the data to send an email or message (like your case)
  • when you need the data to edit another issue (e.g., sum a field to a parent issue), or your rule is already using a branch
    • Remove the lookup issues action
    • Use the Send Web Request action to call the REST API function to search with the same JQL used for the lookup
    • Use the {{webhookResponse}} smart value in place of the {{lookupIssues}}.  I recommend writing that to the audit log first until you understand the structure to parse out the issues.

 

Like # people like this
Adrian Avalos
Contributor
May 31, 2024

@Bill Sheboy thanks so much for your help! My team will proceed without it

Kalyan Sattaluri
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.
May 31, 2024

@Adrian Avalos 

Do you know if you indeed need lookupIssues for your rule.

Depending on the rule requirements, I have been able to do Branch->JQL to get access to data related to issue which is part of the trigger.

Something to consider. Thanks!

Adrian Avalos
Contributor
May 31, 2024

I took a look at the workaround again and was able to build out successfully using first workaround (seen below) along with this posts to visualize Solved: Automation rule - send by mail a recap table with ... (atlassian.com)

 

when you need the data to send an email or message (like your case)

  • Remove the lookup issues action
  • Use the bulk-handling feature of branches and triggers, with the same JQL that was in the lookup
  • With that, the {{issues}} smart value (note that is plural) is used instead of {{lookupIssues}}

 

Like Kalyan Sattaluri likes this
Adrian Avalos
Contributor
May 31, 2024

@Bill Sheboy also by chance have you heard of a smart value that can be used for Time in Status or Total Time in status to send out through automation rule email as added column? Did a quick search and didn't see anything. My guess is it might not be available as it's a field from vendor but figured just double check with you out of curiosity

Bill Sheboy
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.
May 31, 2024

 @Adrian Avalos -- No, there is nothing built-in for time in status smart values.

For out-of-the-box features, process time measures for things like the built-in control chart are likely computed just-in-time from the issue history data.  I do not believe they are in any fields or smart values that customers can access.

It is possible to add custom fields and compute the values with rules, although the solutions tend to be brittle when issues move forwards / backwards in flow.  Simple solutions, such as Age of WIP are not too difficult to implement with rules: https://community.atlassian.com/t5/Automation-discussions/What-is-your-most-useful-automation-Here-is-mine/m-p/1561072#M34

I do not know how any of the marketplace addons compute the values, or if they are exposed as smart values (through custom fields) to automation rules.

Like Adrian Avalos likes this
0 votes
Kalyan Sattaluri
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.
May 29, 2024

Hello @Adrian Avalos 

{{issue.customfield_1234.child.value}} is the correct syntax to reference child value.

Have you tried to confirm you have the correct customfield number?

Maybe reference the field directly..

{{issue.Your Field Name.value}} 

{{issue.Your Field Name.child.value}} 

Adrian Avalos
Contributor
May 30, 2024

Hi @Kalyan Sattaluri I tried all the syntaxes you shared and no luck. Will not display in email being returned and can also confirm custom field number is correct 

Suggest an answer

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

Atlassian Community Events