If I make a JQL query "Sprint in openSprints() and statusCategory != Done" and there are for example 10 Issues found. -> Now I split the query again so that I only have the tickets with the assignee XYZ, let's say 5 of 10 issues are assigned to XYZ. -> Assignee XYZ should now be notified that these 5 tickets are still open via MS Teams or mail.
Now my problem:
{{#lookupIssues}}
* {{url}}
{{/}}
With this smartvalue I get a list of all issues in the above query, BUT assignee XYZ now gets 5 messages with the same content.
Can this be reduced so that he is notified only once?
Hi @Nicolas Zuderell -- Welcome to the Atlassian Community!
For a question like this, please post images of your complete automation rule and of the audit log details showing the run of the rule which does not work as expected. That will provide context for the community to offer suggestions. Thanks!
Until we see that information, I suspect your rule has a scheduled trigger on JQL, leading it to run for each issue in the trigger set. The solution may be to remove the JQL from the trigger and just run on a scheduled...using the JQL exclusively for your lookup issues action. Then only one email will be sent.
Kind regards,
Bill
Thanks Bill to your answer it helped me with my MS Teams notification.
On the Mail i will get this message:
This is my rule:
Do I need a step more or do I something wrong?
Best Regards
Nicolas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Once you removed the JQL from the scheduled trigger, the Send Email now needed another source for that issue information: Lookup Issues.
Please try using {{lookupIssues.size}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have removed all JQL from the trigger and i still get the error from above in the audit log.
I deleted the JQL before i unchecked the box:
also i removed the smart value in the subject of the mail. the content is still to the assignee of the ticket:
{{#lookupIssues}}
* {{url}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you please post images of:
That may indicate what is happening.
The other possibility with Jira Cloud automation rules is they sometimes get "glitched" by changing the components to many times. The way to test that is to disable this rule and re-create it as a new rule and see if that works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Email action:
And here the log between the changes:
i have recreated the rule with the same actions and triggers it dont works neither.
if i put my own mail adress in the "to-section" it works. If i put the assignee (like the first screenshot in this comment) it brings the "some errors" warning
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah...got it. Assignee in that context for the to-email-address is undefined, as there is no issue. They are all in the Lookup Issues result.
The way to solve this is to get the email address from the lookup, and add a safety check condition with this:
For the email address, type/pasted that smart value into the field and it will appear below it, then you can select it.
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.
@Bill Sheboy Thanks for the steps, i tried the same but in my case one assignee received a mail but another did not. could you please suggest? please see attached screenshot
Email:
Also i don't want to send other assignee's tasks details in mail body, both assignee should receive only their own task details in mail body.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @vdhanorkar
Your use case is different as there could potentially be multiple different assignees. As a result you need a different rule, as what you posted references only the first assignee from the lookup issues result.
One possible way to do that is:
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.
Ohai Bill!
So as I laid out in my answer to @vdhanorkar's standalone question over here, I actually branched on {{lookupIssues.assignee.distinct}} in the "For each" so that I could access {{thisassignee.accountId}} for the nested JQL lookup and also use {{thisassignee.emailAddress}} for the To: in the email.
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.
Hi @vdhanorkar ,
Would you mind posting screenshots of your automation here? I'm also looking to send 1 email to all assignees. The body of an email includes all issues returned by a JQL filter. The list of issues is formatted in a table.
I got it all working, except for all assignees. As you can see in the snippet below, I included both {{lookupIssues.assignee.displayName}} and {{lookupIssues.assignee}}. But the actual email sent every Tuesday morning did not include any of the assignee.
Thanks for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to confirm...your scheduled trigger does NOT have JQL, correct?
If so, it appears you want to send that email to all possible assignees for the issues in the lookup issues result. To do that, please update the email TO with the below expression.
{{#lookupIssues}}{{assignee.emailAddress}};{{/}}
That will iterate over the lookup results and add each assignee's email address, followed by a delimiter.
If that sends duplicates to the same assignee, you can adjust that using distinct like this:
{{#lookupIssues.assignee.emailAddress.distinct}}{{.}};{{/}}
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.
Hi @Bill Sheboy ,
Appreciate your quick response.
The Then: Lookup issues has filter as shown below.
I added in the To: field of the email your suggestion of
{{#lookupIssues}}{{assignee.emailAddress}};{{/}}
but still no luck. Only the emails from the customfield_10174 are receiving the email.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you please write that smart value expression to the audit log, and then post an image of what it includes after the rule runs?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy ,
Apologies for my ignorance; but how do I write the smart value to the audit log? Last time i executed the automation, it was successful, but the recepients supposed to be included in {{#lookupIssues}}{{assignee.emailAddress}};{{/}} did not receive an email. Only those in {{lookupIssues.customefield_10174}} got an email.
Here's a grab of the audit log. Though the issues were included in the successful associated items, the email did not include the email address of assignee.
Can you please elaborate on audit log?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is a rule action named Log which allows writing text or smart values to the audit log. Please add that action to your rule after the lookup issues action, including this:
Here are the expected assignees: {{#lookupIssues.assignee.emailAddress.distinct}}{{.}};{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
I think you suggestion is working. The Log action display distinct emails of all Assignees.
I'll put the same smart value in the To: field of the email and see how it goes next week in its next scheduled run.
Thanks very much for your patience and kind support.
Cheers,
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.