I want to be able to do a lookup and then, within that lookup, run logic to show only selected items.
Use Case:
Release Notes or Documentation - Break down sections of an email by business group or project and auto-send the email when the sprint is closed.
<h2>Sales Items</h2>
{{#lookupIssues}}
{{if(equals(issue.businessunit, sales))}}
<hr style="margin: 20px 0">
{{customfield_11407}}</br>
<em style ="font-size:12px;">{{issueType.name}} <b>{{key}}</b> | <span style="color:#00669e">{{customfield_11288}}</span> Deployed: {{Resolved.shortdate}}</em>
{{/}}
{{/}}
<h2>Service Items</h2>
{{#lookupIssues}}
{{if(equals(issue.businessunit, service))}}
<hr style="margin: 20px 0">
{{customfield_11407}}</br>
<em style ="font-size:12px;">{{issueType.name}} <b>{{key}}</b> | <span style="color:#00669e">{{customfield_11288}}</span> Deployed: {{Resolved.shortdate}}</em>
{{/}}
<h2>IT Items</h2>
{{#lookupIssues}}
{{if(equals(issue.businessunit, it))}}
<hr style="margin: 20px 0">
{{customfield_11407}}</br>
<em style ="font-size:12px;">{{issueType.name}} <b>{{key}}</b> | <span style="color:#00669e">{{customfield_11288}}</span> Deployed: {{Resolved.shortdate}}</em>
{{/}}
{{/}}
What is not working as you expect?
Please note when using {{lookupIssues}} with an iterator, you refer to the fields without an issue prefix, such as with:
{{#lookupIssues}}
{{key}} - {{summary}}
{{/}}
When you use {{issue.somefield}} inside of the iterator, it is instead referring to an issue outside of the lookup issues iterator.
Kind regards,
Bill
@Bill Sheboy - Wanting to write all the stories broken down by Business Group
{{#lookup}}
{{if(equals(issue.businessunit, A))}}
{{if(equals(issue.businessunit, B))}}
{{if(equals(issue.businessunit, C))}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information, and here are some ideas to help:
First thing, smart values are name, spacing, and case-sensitive. So it can help to confirm the smart values for your custom fields before proceeding. Please find an example issue with your Business Unit field, and then this how-to article to find the correct smart values: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Next, please look at the examples in this article for smart value, list filtering. You appear to be missing a few of the closing {{/}} for your report sections, as they happen in pairs with conditions, iterators, etc. https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
Next, I suspect your Business Unit field is a selection/drop-down list. If that is correct you need to match on either the id or value for your conditions to work, as shown here for custom fields: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/
For example:
Business Group A
{{#lookupIssues}}{{if(equals(issue.businessunit.value, "A"))}}
{{key}} {{summary}}
{{/}}{{/}}
Business Group B
{{#lookupIssues}}{{if(equals(issue.businessunit.value, "B"))}}
{{key}} {{summary}}
{{/}}{{/}}
Business Group C
{{#lookupIssues}}{{if(equals(issue.businessunit.value, "C"))}}
{{key}} {{summary}}
{{/}}{{/}}
Finally, if you want the sections (e.g. by Business Group) to only include the section titles when they are present, you could use multiple Lookup Issues actions, filtered on the Business Unit, saving the results in created variables, and include all the variables in your output/email.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.