I have several Email Groups that I need to send emails out based of off a Custom field value: {{MOP - Group}}
This field is set up as a short list. example values are
IPA, IPR, Transport, Etc.
I want to when the issue is transitioned to status Under Review
To pull the custom field value {{MOP - Group}} and based off of the value email the group of email addresses that are assigned to that value.
I have very little programming experience and so even with this little thing which is probably very easy I am having trouble with finding a solution.
Any help would be appreciated.
Thanks,
Hi @Gabriel Greenbank -- Welcome to the Atlassian Community!
Is your list of email address only for this rule or for other uses?
If it is just for this rule, perhaps try a Lookup Table to store the email addresses and then key them to the custom field value. Please look here for more information on that method: https://community.atlassian.com/t5/Automation-articles/New-Automation-action-Create-lookup-table/ba-p/2311333
To use that in your email you would enter your table name and custom field as the key, such as this:
{{myTableName.get(issue.myCustomField)}}
Please adjust that based on your custom field's type.
Kind regards,
Bill
Hi Bill,
have you tested this for 'send email action'?
I gave this an attempt now - created a lookup variable named "emails", with key "email" and the following value "email1@at.com; email2@at.com". But when I tried to run my rule the automation failed, claiming that bcc-field in 'send email action' was empty.
When I changed my lookup entry to only contain "email1@at.com" the rule succeeded. So I'm assuming this is due to the fact that the bcc-field (and to-field I guess) in 'send email action' doesn't support semi-colon or other separators in between multiple email adresses.
But not sure if I should've tried another way of referencing the lookup variable in the 'send email action':
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My hypothesis is the BCC field is not recognizing the separate email address, instead only seeing them as a single text value.
Let's try splitting to create a list of values. Assuming your delimiter is "; " then please try this:
{{emails.get("email").split("; ")}}
Please adjust accordingly for your delimiter between the email addresses.
And also...For things like variables and tables in rules, I recommend using a unique naming convention to avoid the risk of matching other smart values. For example, prefix your variable names like this with varMyVariable and the lookup tables with tblMyLookupTable.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To the rescue as always! This worked perfectly, thanks Bill!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The split function worked perfectly in my scenario too! I feel like half the rules I have built I need to somehow give @Bill Sheboy credit as he always seems to have the missing function I need to get my rules to work correctly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The easiest way is to create an automation rule with this items:
1. Trigger - Issue transitioned (there you can choose statuses 'from' and 'to' or leave empty for every issue transition).
2. Condition If-Else with issue field condition based on your custom field value.
3. Action Send email. If condition is met, the rule will send an email to address you choose. You can send email to multiple addresses at the same time. If recipients of these emails are added to your jira instance, you can create jira groups and send email to a jira group. All members of jira group will receive an email.
As result your rule will be similar to what you can see on the picture below:
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! This is the solution I used and it is exactly what I needed. I think that using a Lookup table might have worked as well, But I think that this solution was easier to get my head around.
Thanks,
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.