Automation to email assignee is no longer working

trthomas April 26, 2022

I set up an automation rule to email the assignee a list of their tickets that were in a particular status.  This worked fine until last Friday.  Now I get an error and the automation rule no longer works.  What am I doing wrong?  Each card does indeed have an assignee.  I verified each one myself.  

automation.png

3 answers

0 votes
trthomas April 28, 2022

Thank you everyone for your help.  It is very much appreciated.  What I ended up doing was setting up the Send email to {{lookupIssues.assignee.emailAddress}}

For whatever reason, this is working now.  The only problem I encounter is that it is sending every assignee the entire list of issues and not just their own issues, but at least it is emailing them and not erroring out. 

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2022

Hi @trthomas 

I suspect the issue is in the email body and/or that the lookup issues action returned no results.

To fix the second problem, please add an advanced compare condition before you send the email

  • first value: {{lookupIssues.size|0}}
  • condition: greater than
  • second value: 0

If you want to email even when there are no issues, you may need to adjust your email body or instead use an if/else structure in your rule.

Kind regards,
Bill

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2022

Hi @trthomas 

Regarding the new problem you noted of sending every assignee the list of all issues, you can try to solve that with the list distinct() function, advanced branching, and repeated lookup issues calls:

  • create a variable with the list of distinct assignees from the lookup issues using {{lookupIssues.assignee.distinct}}
  • use an advanced branch on the created variable as a source, such as {{varMyCreatedVariable.split(",")}}
    • repeat the lookup issues action, adding to the JQL so it selects just the branch's assignee
    • use a condition to confirm the lookup issues count is greater than 0
    • send an email to the specific assignee with their issues, using {{lookupIssues.first.assignee.emailAddress}}

Kind regards,
Bill

0 votes
Filipi Lima
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2022

Hello!

Could you clarify if you're running a JQL in the "When: Scheduled" component?

Since your lookup action is quite simple, I'd suggest adding that JQL on the first component.

image.png

If you still prefer to use the Lookup issues then you'll need to use the {{lookupissues}} smart value and iterate through it to send the e-mails. 

Suggest an answer

Log in or Sign up to answer