Background
I, a very green Automation user, am trying to use the Jira Automation plugin to gather details from issues and send them to different email distributions which are based on a component in the issue.
For context, we have a few different api's utilized by different clients. E.g., flavor 1 is utilized by clients A, B, and C, flavor 2 is utilized by clients D, E, F. When we release a version with changes to flavor 1 I want to collect the value from a custom property and send them in an email to a distribution which contains info for clients A, B, C. I would like it if the automation could do this for N (well, up to 200 since I would like to use the lookup table), flavors. It seems like I could get around this by instead creating N different rules for each specific flavor, but this quickly becomes tedious to maintain.
Based the on actions I have available, I want to be able to do the following.
- When: Version released
- Then: Create lookup table with keys that correspond to the api flavor and values that correspond to the email distribution for that group of clients.
- For each: api flavor
- If count of issues in this version > 0
- then send email to email distribution for api flavor (based on value in lookup table) with subject of version and content is a bulleted list of the custom property of the change summary
The Problem (in my understanding, or a limitation?)
Are we able to loop over the Key in a custom lookup table?
Are we able to access the corresponding Value in a custom lookup table while using a branch/loop?
Is this approach even feasible??!! Am I really better off just creating N individual rules to handle this?
My Attempt
When: Version released
Easy enough... 
Then: Create lookup table
Easy enough...

For each: Smart Value
How can we iterate over the key a lookup table?

Assuming we can, we will proceed...
Then: Lookup issues
Gather all issues using lookup issues JQL where apiflavor property is our custom apiFlavor smart value we are trying to iterate over, and the issue is in our version. Should probably also include a filter for ticket status and resolution...

If: Compare two values
Only continue if there are issues for this flavor so we don't spam our clients with blank emails...

Then: Send email
I would like to pull the value, the email address, from the lookup table. Though I am not sure if this is possible.

As a kicker, I'd also like to send a notification to myself and our deployments group so they are aware that clients have been notified.
