I'm using Automation on Jira Cloud to generate a Release email once a version is released. I've used Lookup Up Issues action using JQL against the version id, which works fine. I then log the value {{lookupIssues.size}} to confirm that this smart value returns a number, which it does in the audit log. I then want to use that value within the email content, but instead of returning the number of tickets being released, it duplicates the line of text for the amount of times of the smart value.
My code within the email is:
Hot Fix {{version.name}} included these items:
{{#lookupIssues}}
Total number of items released: {{lookupIssues.size}}
{{/lookupIssues}}
The output in the email is:
Hot Fix <version name. included these items:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
Total number of items released:
The audit log value is: 14 and as you can see 14 rows are duplicated above.
The full email code is:
Hot Fix {{version.name}} included these items:
{{#lookupIssues}}
Total number of items released: {{lookupIssues.size}}
{{/lookupIssues}}
Stories
=======================================
<ul>
{{#lookupIssues}}
{{#if(equals(issuetype.name,"Story"))}}
<li><a href="{{url}}">{{key}}</a>: {{issuetype.name}}: {{summary}}</li>{{/}}
{{/lookupIssues}}
</ul>
Bugs
=======================================
<ul>
{{#lookupIssues}}
{{#if(equals(issuetype.name,"Bug"))}}
<li><a href="{{url}}">{{key}}</a>: {{issuetype.name}}: {{summary}}</li>{{/}}
{{/lookupIssues}}
</ul>
Tasks
=======================================
<ul>
{{#lookupIssues}}
{{#if(equals(issuetype.name,"Task"))}}
<li><a href="{{url}}">{{key}}</a>: {{issuetype.name}}: {{summary}}</li>{{/}}
{{/lookupIssues}}
</ul>