Forums

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

Loop through issues, if condition is met, send email but not every time

Samuel Sajasi January 17, 2024

Hi Team,

 

I have a bunch of filters defined.

Using filters ID I can grab a list of issues like so:

filter=12394 OR filter =12300 OR filter = 12268

There is user defined field lets call it assignee2 in each issue which is set to a user like an assignee.

say there are 5 issues in my list where assignee2 is set to Sam.

I like to create a list of {{issue.url}} and we are done looping through the issue send an email with those issue urls all in one email instead of sending 5 emails.

 

How is this possible?

 

right now i can send an email every time i find an issue where assignee2 is not empty with issue url in the email, but i like to combine that result into one email

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.
January 17, 2024

Hi @Samuel Sajasi -- Welcome to the Atlassian Community!

Are you trying to accomplish this with an automation rule?  If so...

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

I suspect your rule is either using a scheduled trigger with JQL or is using a branch with that JQL, and those include multiple issues for each user...leading to multiple emails.

To send one email per user the rule must identify the unique / distinct users, and then loop over them to send the emails, such as with an Advanced Branch, and filter by the loop variable's user.

Kind regards,
Bill

Samuel Sajasi January 18, 2024

 

 

Hi Bill,

 

Thank you for your reply. This was approach to this. Using schedule trigger with JQL. I know how to approach this in say python but I cannot figure out with Jira automation.

 

Thanks a million.

Sam

Samuel Sajasi January 18, 2024

Screenshot 2024-01-18 122125.png

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.
January 18, 2024

Thank you for that information.

You appear to have most of the parts needed in the rule, with some adjustments:

  • Remove any JQL with the scheduled trigger
  • Instead, only use the JQL with the Lookup Issues action, and add the condition you have on the Quarterback field to the JQL
  • Your rule can then send just one email, iterating over the values in the Lookup Issues results

For an example of that, please look here:

https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues

Suggest an answer

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

Atlassian Community Events