I see many examples and questions regarding sending a single email message containing all the issues returned by the Lookup Issues action.
What I am trying to do is to send one unique email message to the assignee for each issue found by the Lookup Issues action.
Is this possible?
If so, examples would be very helpful, if available.
TY
Unfortunately, there is no rule-defined looping structure yet for automation, to span the possible assignees.
I can think of two ways to do this if-and-only-if you have a defined list of possible assignees.
Best regards,
Bill
Hi @Bill Sheboy
Thank you for the suggestion. I did a little more digging and seem to have it working although it seems like I had to some redundant logic. Feel free to critique my approach as I am new to using Automation.
The job is a scheduled job that runs every 3 days.
It runs a JQL search that looks for a list of issues that match my criteria.
The action that it runs is a "Lookup Issues" that runs the same JQL as the scheduled job.
Then I added a branch using the "Current Issue".
In the branch I run the same "Lookup Issues" job as above, with the exact same JQL.
Still in the branch, it uses the Send Email action and I can use the Assignee in the To: box.
Then the subject is "Issue {{issue.key}} requires review."
The body of the email looks like this:
{{issue.issueType.name}} issue {{issue.key}} in project {{issue.project.name}} with status {{issue.status.name}} assigned to {{issue.assignee.displayName}} requires review.
This sends a separate email for each issue that matches the criteria, with the issue key of each individual email in the subject and the fields in the body use the values from each of the issues found.
So, if I own 5 issues and my colleague owns 3, they will get 3 emails, one for each issue they own, and I will get 5, and each email will show the individual issue key and other values as shown in the body.
I'd love to trim it down a bit if I can get away with it, I figure one of the JQL searches is unnecessary, probably the one the Scheduled job, but this appears to work so I am going with it for now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sending one email for each issue is what @Mark Chaimungkalanont was also suggesting. For that, you would just use the scheduled trigger with JQL, and use another other criteria with conditions before sending the email. If that works for your team (getting multiple emails), you are done!
If that gets too noisy, you can try the other more complicated approaches to send one email per assignee.
There is a non-automation solution to this: filter subscriptions. For that, you create a shared filter, and anyone can subscribe to get an email on their desired frequency. Please look here to learn about that method:
https://support.atlassian.com/jira-core-cloud/docs/work-with-search-results/
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As a variation on what Bill suggested, could you use the "Scheduled trigger"? That allows you to specify a JQL and will run the rule once for each matching issue, so you can send an email for each matching issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will try that but I think that I did try something similar originally and it complained that the To: field was empty, which I interpreted as not being able to extract the Assignee from the results of the JQL search. I will revisit that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have Jira automation, you should be able to set a trigger, condition, and then action with send e-mail.
In the send e-mail action, you can select assignee and run your lookup issues.
See this link on an example how lookup issues is setup with the e-mail:
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.
Thank you Benjamin. I should have been more specific. I am working in the Jira Cloud and it uses the {{lookupissues}} smart value instead of {{issues}} as in the server version. The problem I have with setting the assignee is that when Lookup Issues returns the list of matching issues, it won't let me set "Assignee" in the To: box of the "Send Email" action. It continually complains that the "To:" field is empty, which makes me think that I have to somehow select the {{lookupissues.assignee.emailAddress}} in the To: box which works but sends me one email for all the matching issues found by Lookup Issues, and what I want to do is to send one email for each matching issues, even if they are to the same email address. The link that you sent appears to be for Server and not cloud and I don't see anywhere in the example where the To: address is set and I have tried to use the cloud version of that code but it won't fire without a To: Thanks though
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can use this:
{{#lookupIssues}}{{assignee.emailAddress}} {{/}}
In the header or the body of the email and it iterates through the list very nicely but when I try it in the To: box, it fails with this error:
Error sending email:Domain contains control or whitespace
I also tried branching after the lookup issues step to see if I could get it to iterate that way and it complains:
Can't branch rule as it requires issue(s) in the context for this option. More than likely you have a trigger that doesn't insert issues into the rule chain. e.g. Scheduled rule not running a JQL query. Creating an issue does not put an issue into the context, you have to branch on it directly.
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.