I am trying to send an automated email to the reporters of issues when we release into production. I have the email aspect working nicely when it sends to my email address. I am able to list the epics included in the release by defining a lookup JQL statement.
The body works fine to display the URLs for the epics included in the release. Since my JQL is defined before my email component, and my email component can access the epics without a problem, I can't understand where I'm going wrong with referencing the same smartvalue in the "to" for my email.
My "to" looks like {{#lookupIssues}}{{Reporter}};{{/}} but I get the error:
Could not send email, the 'To' address field is empty. If you have referenced a field it may be empty.
The Reporter field isn't empty, (it's me in this test), so could someone point me in the right direction please?
To help troubleshoot rules, I always like to use the "Audit log" action - in this case to see what your lookupissues smart value expression evaluates to.
In my test, it looks like this:
I'm guessing that's not quite what you expected (it's not an email address). It's actually the user ID, which is what Atlassian uses to identify users.
As noted here, you probably want to write something like reporter.emailAddress instead.
Additionally, you might find problems with the trailing ; character. Remove that in your early testing when there is just one email, to confirm that everything else works in that simple case.
Then you may have to experiment with what works (comma instead of semicolon perhaps?) to support multiple emails. Reference this documentation if you find a need to use separator characters between email addresses but omit the last one.
Hi @Tim Foster -- Welcome to the Atlassian Community!
Yes, and...to the other responses: You may be getting an issue from any trailing delimiters, so you can selectively add the delimiter like this:
{{#lookupIssues}}{{reporter.emailAddress}}{{^last}};{{/}}{{/}}
This will add a semicolon between all the addresses, and leave off the last one.
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.
Thank you, all of you, for your help. However, I am still not able to get this working correctly.
I have added a Log Action: {{#LookupIssues}}{{reporter.emailAddress}}{{/}} but it displays nothing. I have tried changing this to: {{#LookupIssues}}{{key}}{{/}} but still it displays nothing. The action details shows:
{{#lookupIssues}}{{reporter.emailAddress}}{{^last}};{{/}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm, actual screenshots of your rule and the components of interest might help. At this point, all I can say is "works on my box" (works in my cloud?). See below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mykenna Cepeksince his JQL returns multiple issues would that cause a problem or would automation just loop through all the issues?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and...smart values are usually case-sensitive. So please check if you are using {{lookupIssues}} in your log entries and the email TO address list. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Tim Perrault The rule I shared above works fine with multiple issues/emails. I just tested it.
It is unfortunate that the same email may be repeated multiple times. But the effort in Automation to de-duplicate a list would be best handled in a separate post.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mykenna Cepekawesome! Wasn't sure about that. Thanks for checking :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The jql I'm using only returns 1 task for this test. It could, and probably would include more (if I ever get it working!), but the test is only using one.
Everything else in the automation seems good. If I add my hardcoded email into the "to" I get the email with the jira(s) linked nicely, but I'm the only one in the list. I'd be happy if I got mutiple emails for being the reporter and hardcoded at this stage :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mykenna, did you try to actually send the emails? I just tested and it failed for me too:
It appears there is a problem with Send Email and use of smart values which are not in one issue.
@Tim Foster ...I suggest it may be time to submit a ticket to Atlassian support for this one: https://support.atlassian.com/contact/#/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy I did not try to actually send emails.
@Tim Foster wasn't even able to get results from the dead-simple Log Action, and I saw no need to go further until he was able to get that to work.
There may be issues with the separator character (semicolon, comma, etc), which I mentioned previously. Again, seemed premature with no actual smart value output.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tim Foster and welcome to the community. Reporter by itself will bring up the user ID. You want to use this instead:
{{reporter.emailAddress}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tim Foster
Firstly that's a cool name you got :)
Try using this smart value {{reporter.emailAddress}}
Thanks,
Tim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this smart value and let me know if this works {{issue.reporter.emailAddress}}
I was able to send an email, but my automation is very simple.
Thanks,
Tim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nope, still the same problem. I think I'm going to abandon the idea of the email and just have it post to the Teams/Slack channels instead.
Thanks for your help with this though. I've learned more from these boards, than anywhere else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bummer. Are you able to post a screen shot of the steps of your automation? I want to fiddle around with this more on my off time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
These are the steps I have. It's not a complex automation by any means
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Tim FosterThanks! I'll let you know if I can get something working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tim Foster
Did you note you have some square brackets, not curly ones in your smart values in the image? The smart values should only use curly brackets.
Thanks,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I hadn't noticed that, thanks Bill. However, I'm getting the same error after correcting it. I never see the log detail as per the screenshot from @Mykenna Cepek though, so I think something is amiss elsewhere (although that wouldn't have help, so thanks for spotting that)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow! Good catch @Bill Sheboy This reminds me when I was connecting to a database one time was using jbdc instead of jdbc :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tim Foster ,
You can try this,
{{lookupIssues.reporter.emailAddress}}
I success to do this,It will sent email to reporters!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ivanna -- Welcome to the Atlassian Community!
Context is important for automation rules, so I suspect the reason your reference to just Reporter failed is there is no issue at that rule scope.
If you believe it is something else, please create a new question (rather than adding to this one), posting images of your rule and the complete audit log details of the rule run for context.
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.
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.