Overarching goal - send last month's report to customer.
Logic:
1. Get last months JSM tickets
2. Iterate for each related Organization associated with the ticket.
3. Filter tickets for current Organization
4. Inside the branch send email - summary of tickets for each Organization.
5. The email content generates just fine!
6. PROBLEM - the automation sends same amount of emails as the number of tickets for that org. For example, if I have Org A with 1 ticket, Org B with with 2 tickets, and Org C with 3 tickets, I am getting 1 email for Org A, 2 identical emails for Org B, and 3 identical emails for Org C.
7. Problem of dups disappears when I change Advanced Branching Smart Value
from:
{{lookupIssues.Organizations.flatten.distinct}}
to:
{{lookupIssues.Organizations.flatten.name.distinct}}
How to fix and avoid getting duplicate emails when using {{lookupIssues.Organizations.flatten.distinct}}?
Reasoning for why I cannot just fall back to {{lookupIssues.Organizations.flatten.name.distinct}} which works fine, no dups: I also need the Org's Id and I don't see the way to extract it when iterating over Org's name, I need to iterate over Org's object.
Thanks!