Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,915
Community Members
 
Community Events
184
Community Groups

Lookup Issues 2 Variables

Hi,

Can a single automation create 2 variables from a "lookup issue"?

My intention is to send an email via automation, which will display result from 2 different lookups.

 

Lookup1 => Variable1 (list)

Lookup2 => Variable2 (list)

 

The email would display both lists.

Can this be done?

 

2 answers

1 accepted

0 votes
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 12, 2022

Hi @Hagay and welcome to the community

Unfortunately you can only have ONE lookup at a time. I mean you can place as many lookup components as you like, but every time you place, it will "erase" the previous lookup's results.

To your case I would either:

  • Send two different emails on the same rule
    • Lookup1
      • Send email
    • Lookup2
      • Send 2nd email
  • Create two different rules
  • Use a webhook to get a JSON payload and then work with that in your email
  • Try to store the lookup1 results on a new variable and then work with that. But keep in mind that most likely the new variable is going to be a text variable.

Thanks Alex.

Sending two emails / creating two rules will both result in something different from what I want to achieve, so that irrelevant for me.

 

I didn't understand your last suggestion.

If it's possible, I can also combine both lookups to a single one, and split it when iterating, but I didn't find a way to do it. Something like an "if" clause within the loop

Lookup 1 results:
{{#lookupIssues}}
  * //IF CONDITION1 {{key}} - {{summary}}
{{/}}

Lookup 2 results:
{{#lookupIssues}}
  * //IF CONDITION2 {{key}} - {{summary}}
{{/}}

 Is something similar to this possible?

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 12, 2022

Conditional logic exists on smart values https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/

However I'm not sure how you are going to use it, since {{lookupIssues}} will only yield results from one JQL.

Jira automation provides a component "Create variable". Read more here https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-variable

Issue solved.

I eventually did it by using a single JQL lookup, and then splitting the result using a condition. 

This was possible only because, luckily, the 2 lists I wanted to display are quite similar and can be fetched in a single JQL. The lists differ with a single attribute. Otherwise my solution wasn't useful.

 

Sketch:

<h3>First List</h3>
<ul>{{#lookupIssues}}
{{#if(key.startsWith("AAAA-"))}}
<li>{{key}} - {{summary}}</li>
{{/}}
{{/}}</ul>

<h3>Second List</h3>
<ul>{{#lookupIssues}}
{{#if(key.startsWith("BBBB-"))}}
<li>{{key}} - {{summary}}</li>
{{/}}
{{/}}</ul>

 

 

Like # people like this

Hi Hagay

I was trying to implement similar automation, and was able to figure out by declaring two variables and fetching the variable value in email. I have used two separate JQL  lookups and was able to format the list with the help of your sketch file.

Suggest an answer

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

Atlassian Community Events