Hello,
TLDR: Lookup Issues action used to send a single email list to a user for all their assigned issues using a "distinct" smart value essentially breaks when "Run a JQL search" is enabled on the Scheduled trigger, which is done to enable an additional action (Add a comment to the issue).
Details:
I'm attempting to create a Jira automation which does 2 things:
1. sends a single email to the assignee of all issues returned by the jql query, for all issues they are assigned to.
For example, if I have 5 issues and 2 are assigned to user A and the other 3 to user B, then User A will get an email with their 2 issues, and user B will get one email with their 3 issues.
This approach (use a Lookup issues action, which runs a jql query) as documented by Atlassian works perfectly for that. However...
2. Add a comment to every Jira issue that was returned by the same jql query, in the same automation as above.
I thought this would be as simple as adding a "add comment" action, but when I try that, I get this error:
The only remedy I've found for this error, is to go back to the automation trigger (a Scheduled trigger), and enable "Run a JQL search and execute actions for each issue in the query":
Now, this works just fine - it does add the comment to the issues returned... but it breaks #1 above and instead of User A and User B each getting a single issue with their respective lists of issues assigned, they each now get one email for every issue. So each of these actions work perfectly on their own, but do not work properly when part of the same automation.
Any suggestions? Thank you very much in advance!
Following that how-to article helps to send one-email-per-assignee with their respective issues: https://confluence.atlassian.com/jirakb/automation-to-send-email-only-once-per-assignee-1310985609.html
Please note that the rule uses the advanced branch over Assignees and not issues. As a result, the Comment on Issue action has no issues on which to act. That is what the generic error means: the action / condition needs an issue and one is not present at that point in the rule.
If you want to add comments to the issues, the rule would need to separately branch on issues. (But not add JQL to the scheduled trigger, as that would create other problems for this type of rule.)
Before you add that, what is the purpose of the comment you adding? To which issues does it apply?
Kind regards,
Bill
"Please note that the rule uses the advanced branch over Assignees and not issues. "
Thank you for this, I do not know much about advanced branching or how it works, so this was very helpful!
"Before you add that, what is the purpose of the comment you adding? To which issues does it apply?"
The requirement is essentially, "email the assignee and then add proof to the record that the assignee was emailed." So, the comment should apply to the same set of issues, using the same JQL query, as the issues on which the assignees were emailed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You described the "what" you are trying to do, and not "why do this". Such as, "why is proof needed a reminder email was sent?"
In my experience, sending scheduled reminder emails is a "smell" there is a root cause, process problem. Perhaps meet with the team to use a 5-whys or other RCA method to learn that root cause and how to address it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After considering your comment, I added a separate branch for adding the comment to each issue and it worked without problem, thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the Atlassian Community!
My name is Prosper, and I’m a Support Engineer at Appfire. I’m here to help.
If you’re open to a plugin suggestion, I recommend trying our app, JIRA Misc Workflow Extensions for JIRA Cloud. You can create a scheduled action to achieve the result you are looking for in one automation:
Please refer to the attached screenshot for more details.
You can also find more information in our documentation. If you have further questions or need assistance, feel free to open a support ticket. We’d be happy to help!
Best regards,
Prosper
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.