Forums

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

How to send 2 different emails from one automation based on a JQL in Jira automation?

John Jos July 17, 2023

Hi,

I am new to automation and I am trying to find a way to send different emails using just one automation based on a JQL output.

I have a JQL issue lookup that looks something like this:

(project = ABCD AND resolution = Unresolved AND status = "Waiting for Approval")

>>If this gives an output, it should send an email with the words:

"Hi - There is an issue waiting for your approval" (I put in a syntax to lookup the issue and send the URL of the issue to the recipient.)

>>If this does not give an output, I want it to send an email stating that there is nothing to approve and ask the recipient to check manually from their end.

If I put them in the same automation, it does not do anything since there is no output so I get 'No action performed' in the log.

So for now I have configured 2 automations based on the JQL and using the 'Related issues condition' and it works.

I am trying to understand if there is a way to put only one automation with either or condition or something similar. Any help and advice would be greatly appreciated.

Thank you.

2 answers

1 accepted

4 votes
Answer accepted
Charlie Misonne
Community Champion
July 17, 2023

I assume you are using the Lookup issues task to fetch the issues?

You could use an if/ else condition where you check for any results returned by the lookup issues action: {{lookupIssues.size}} > 0

Like this:

2023-07-17 13_20_47-Automation - Jira.png

Then you can configure the send mail actions depending on the outcome:

2023-07-17 13_22_57-Automation - Jira.png

John Jos July 17, 2023

This works like a charm.. Thank you so very much for the quick reply and the quick fix @Charlie Misonne

:)

Like Charlie Misonne likes this
Charlie Misonne
Community Champion
July 17, 2023

glad I could help!

Like John Jos likes this
1 vote
Mohamed Benziane
Community Champion
July 17, 2023

Hi,

You could create a subscription using this functions in your jql

https://support.atlassian.com/jira-software-cloud/docs/jql-functions/

John Jos July 17, 2023

Thank you for your response, @Mohamed Benziane. I tried the Charlie's steps and it is now resolved. I will refer to your document in the future. :) 

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