Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation error with If statement

jorge_rive
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2025

with the help of AI, trying to setup an automation that summarizes all the tasks for my team, for the last 7day, including the statut, last comment, etc.  grouped by assignee and sends a single email to me with the summary.  

in the body of the email, I'm doing this,

 

**Weekly EE Project Task Updates (Last 7 Days)**

{{#lookupIssues}}

    {{#if(assignee)}}

       ### Assigned To: **{{assignee.displayName}}**

       {{#issues}}

         - **Issue Key:** [{{key}}]({{url}})

         - **Summary:** {{summary}}

         - **Status:** {{status.name}}

          - **Last Comment:** {{#comments.last}}{{body}}{{/comments.last}}

          - **Last Updated:** {{updated.format("yyyy-MM-dd")}}

      {{/issues}}

   {{/if}}

{{/lookupIssues}}

 

The audit log shows this error:  2025-02-19_13-42-19.png

I can't figure out what is wrong with this if statetment.

 

1 answer

1 vote
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.
February 19, 2025

Hi @jorge_rive -- Welcome to the Atlassian Community!

First thing: whichever bot provided that suggestion, it is quite wrong in many, many ways; I respectfully suggest not using it in the future. 

In general, and in my opinion, such tools (including the built-in guesser from Atlassian) do not have the context of your Jira install type, site, project, issue type, field values, etc. configuration.  And thus they cannot accurately create non-trivial automation guidance.

 

Back to your question...

Next, you appear to be using Jira Cloud.  Is that correct?

If so, the bulk handling feature for Cloud is the Lookup Issues action with the {{lookupIssues}} smart value: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues

The plural {{issues}} smart value is only used with Jira Server and Data Center.

 

To just report on the issues updated in the last 7 days, simple JQL with the Lookup Issues action would work.

But you note an additional requirement: grouping the results by assignee.  That is not possible as JQL is not an SQL (with group-by features) and the no rule actions or list functions to do so either.

There are two possible workarounds, depending upon if you have a known / defined list of possible assignees:

  • If you do not know the possible Assignees, just add an ORDER BY Assignee ASC clause to the JQL for the lookup.  That will at least list the issues in that order, perhaps in a table with an Assignee column.
  • If you know the possible Assignees...

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events