All,
I'm looking for a way to iterate over the Request participants field within a JSD issue and if the email domain is not "companyname.com", then send that participant an email.
For example, if the Request participants field contains:
How do I send an email to only the Request participants with an email domain of "company1.com" via Automation for Jira?
Note: don't worry about the trigger event for the automation and/or just assume "When: Issue commented"
Thanks,
Paul
All,
For those looking for how I solved this, then here it is. I leveraged Automation for Jira (now baked into Jira) and used the following smart-value for the email's To: field...
{{#issue.Request participants}}{{emailAddress.replaceAll("(.*supportcompany.*)","")}},{{/}}
The above smart-value will essentially remove all email addresses containing the "supportcompany.net" string from the To: field.
Note: my original request was how to only send emails to a specific email domain, but in actuality, I need to send emails to all email domains sans a specific one. The above solves this requirement for me.
-Paul
Hey @Paul Benati
Something like Scriptrunner may be better for a situation like this but here's what I think you can do in AFJ.
I"m assuming that the list of participants you want to email are a standard group. If I am wrong and this list is not the same group of people, you probably cant use this solution.
You can set up an IF Statement to check the "Requested Participants" field. You would select a single user from the people you want to notify because this is only checking to see if that one user is in the list. If they are it will then send an email to them. Then you would set up a branch to run a new set of conditions and actions. This would then check the same issue for the next person. Repeat this as many times as necessary.
Here is a picture of an example I made. I did it this way because as far as I know, you cant pull the list of participants and dynamically send emails to only certain people.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cody,
Thanks for your reply. I don't think this will work as I don't know how many people are in the Request participants field ahead of time. I was hoping there's some mechanism to do something like:
If: all match
then
{{#issue.Request participants}}{{emailAddress}}
if(emailAddress.substringAfter("@")="company1.com", then sendEmail(to:emailAddress;subject:"blah";body="blah, blah")
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.