Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue Regarding #lookupisssues

Nguyễn Thành Long September 16, 2023

I am setting up an automation that:

  1. Lookup Issues
  2. Send an email that have the table referring to issues' custom fields but the expected output to be in a table format of 6 columns - 1 column is issue.summary and the rest is issue.customfield:

    <p>{{#lookupIssues}}{{/}}</p>
    <table style="border-collapse: collapse;" width="100%">
    <tbody>
    <tr>
    <th style="border: 1px solid #000000; background-color: #cdcaca;" valign="middle">Code</th>
    <th style="border: 1px solid #000000; background-color: #cdcaca;" valign="middle">T&ecirc;n X&eacute;t Nghiệm</th>
    <th style="border: 1px solid #000000; background-color: #cdcaca;" valign="middle">Gi&aacute; Walkin Cũ (Old)</th>
    <th style="border: 1px solid #000000; background-color: #cdcaca;" valign="middle">Gi&aacute; Doctor Cũ (Old)</th>
    <th style="border: 1px solid #000000; background-color: #cdcaca;" valign="middle">Gi&aacute; Walkin Mới (New)</th>
    <th style="border: 1px solid #000000; background-color: #cdcaca;" valign="middle">Gi&aacute; Doctor Mới (New)</th>
    </tr>
    <tr>
    <td style="border: 1px solid #000000;" align="center" valign="middle">{{issue.customfield_10704}}</td>
    <td style="border: 1px solid #000000;" align="center" valign="middle">{{issue.summary}}</td>
    <td style="border: 1px solid #000000;" align="center" valign="middle"><a href="{{customfield_10744}}">{{issue.customfield_10744}} </a></td>
    <td style="border: 1px solid #000000;" align="center" valign="middle"><a href="{{customfield_10745}}">{{issue.customfield_10745}} </a></td>
    <td style="border: 1px solid #000000;" align="center" valign="middle"><a href="{{customfield_10664}}">{{issue.customfield_10664}} </a></td>
    <td style="border: 1px solid #000000;" align="center" valign="middle"><a href="{{customfield_10665}}">{{issue.customfield_10665}} </a></td>
    </tr>
    </tbody>
    </table>

However, only 1 issue is show in the email (1 row) even though as I check the audit log, the query found 2 issues. 
If anyone can provide some insights or hints to help, please let me know :( Thanks for your attention.

1 answer

1 accepted

5 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.
September 16, 2023

Hi @Nguyễn Thành Long 

When you use Lookup Issues to iterate over the issues, you start the iterator, access the issues, and then close the iterator.  For example, 

{{#lookupIssues}}
{{key}} - {{summary}}
{{/}}

But in your expression you have this at the beginning:

<p>{{#lookupIssues}}{{/}}</p>

And then reference the fields later, so the values are null as they are outside of the iterator block.  Please try moving the closing {{/}} to later, perhaps after all rows have been added.

Kind regards,
Bill

Nguyễn Thành Long September 17, 2023

Thanks @Bill Sheboy
After playing around with placements of the closing {{/}}, I was able to get exactly what I planned out to do.

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events