Would it be possible to setup an automation rule for sending an email to an unique email address for each option(s) selected randomly in a multi-select choice custom field in Jira DC?
I have a multi-select choice field "tags" with 10 option values in a Story issue type. Now whenever user makes a selection either one value or multiple values then Automation should send out an email accordingly.
Custom field name: Tags
Options: A, B, C, D, E, F, G, H, I, and J
Corresponding Emails: Option A -> A1@gmail.com, Option B -> B2@gmail.com, Option C-> C3@gmail.com, Option D -> D4@gmail.com, Option E -> E5@gmail.com, Option F -> F6@gmail.com, Option G -> G7@gmail.com, Option H -> H8@gmail.com, Option I -> I9@gmail.com and Option J -> J10@gmail.com
My current automation rule is not working as expected.
Trigger: Field Value changed
If Condition: tags equals A then send email to A1@gmail.com
Else if: tags equal B then send email to B2@gmail.com
and so on till Else if: tags equal J then send email to J10@gmail.com
This automation rule works only for a single selection in tags field and if I select more than one value then this rule fails obviously. Now rather listing all combinations and permutations inside this if condition loop, would it be possible for automation rule to send all corresponding emails for any number of options selected inside the tags field randomly?
Hi @VVC
First, here are some questions to clarify the scenario you are trying to implement:
How many different email body contents are there: one to send to everyone or a different one for each recipient?
When do you want to send the emails? That is, every time the field changes send an email to each selected recipient, or something else?
What does the "random selections made" mean? Do you mean any values could be selected, or that there is some actual randomizing happening?
Until we know the answers to those questions...
With the if / else block in rules, one-and-only-one of the choices is selected. It does not process each entry which meets the criteria.
Jira Data Center's version of automation does not support the Lookup Table or Advanced Branch features yet. Thus your workaround options depend on the answers to the questions above. A couple of options are:
Kind regards,
Bill
Thanks @Bill Sheboy for asking these questions and see below for my response. Please let me know if this helps further to draw a concrete solution.
How many different email body contents are there: one to send to everyone or a different one for each recipient?
VVC: About 7 option values has same email body contents, while the remaining 3 option values have different and unique email body contents. Each recipient is different, so each one has unique email address. In other words, 7 recipients has same email body contents, while the remaining 3 recipients has different email body contents.
When do you want to send the emails? That is, every time the field changes send an email to each selected recipient, or something else?
VVC: Email(s) should be sent out to each unique recipient as soon as the field value changes in the ticket.
What does the "random selections made" mean? Do you mean any values could be selected, or that there is some actual randomizing happening?
VVC: Any value or multiple values could be selected randomly based on the internal business process on this multi-select choice custom field called tags.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Based on your answers, the rule could use first approach I described with branching. For example:
As I noted earlier, this would send an email to each selected value's recipient every time the rule runs. If you instead only want to send the email once, some indicator must be saved (such as with another field) to detect the email was already sent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bill, I have been trying few different ways to get this working and if I remember correctly, the condition field contains "value A" works which sends the email once. But when selecting multiple values randomly either during the ticket creation or ticket update operation, the emails to the individual recipients doesn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The trigger for field value changes only fires when an issue is updated. When you want the emails for Issue Created also, the rule will need to be duplicated to use that trigger.
For an issue update which does not send the correct emails, you would need to research that for each case to determine the cause. Note that if you leave the field when selecting the values, that will trigger the rule each time the field changes.
And once again, without seeing images of your complete rule and the audit log details, these are just guesses. I recommend trying what is described above to learn what helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The if, else condition with Advance compare two values seems like a good fit so far. I would also like to extend the automation to stop sending email if a pre-existing option is unselected at any point. Is there a way to stop the notification, if an existing option is unselected?
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.