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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


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
Community Members
Community Events
Community Groups

Comment and Link older Keys in "LookupIssues" results


I have an automation that runs a {{lookupIssue.key}} that usually returns a set of 2 or 3 results. Example: run on the A1 issue » returns A2, A36 and A87

From those results, I want the automation to change the status of the two newer results, A36 and A87 to a specific status and the oldest one, A2, to another. How can I do that?

Also, from that list, how can I comment and link the results found like this:

On issue A1: "A2, A36 and A87"
On issue A2: "A1, A36 and A87"
On issue A36: "A1, A2 and A87"
On issue A87: "A1, A2 and A36"

Right now, I can only comment and link the issue A1 with the issues "A2, A36 and A87", but not the results the Lookupissue finds. How can I do that?

Thank you for your help! 😉

1 answer

1 accepted

0 votes
Answer accepted
Mark Segall Community Leader Apr 19, 2022

Hi @Tiago Leite and welcome to the community!

It would help if you could share a screenshot of your rule so we can get a little more context of what you're trying to accomplish. 

Without that additional context, I'm not even sure the lookup issues action is required.  Based purely on what you shared, you could accomplish this with two branch rules...  One based upon a query that returns the "newer" issues and the second pulling in the older issues.  Then perform the transitions within each branch.

Hi @Mark Segall ! Thank you for your reply!

Here's the first phase of this search, just before the comment + link on the results found on the "lookupissues" keys.

I'm able to change those results to "Investigation in Progress" and assign them, but I can't find a way to comment and link them individually with the rest of the results and the trigger issue (referred as A1 on this post). 

 Screenshot 2022-04-19 14.24.10.png

Mark Segall Community Leader Apr 19, 2022

So if I'm understanding correctly, you're attempting to identify when an issue is created whether it is a duplicate and then close if true.  Is this correct?

I'm not following your intent behind the branch rule.  It appears that you're trying to transition any issues with similar description to "Investigation In Progress" and assign to the user who triggered the event.

That's it! It basically looks for duplicates and closes them as "Duplicate tickets".

What I want is to leave the oldest one that it could find on the "lookupissue" in "Investigation in Progress" but for that, I need to order those results from oldest to newest. The other tickets can be closed as "Duplicates" too, only the oldest one matters.

In addition to that, if there's 4 tickets, I want them linked to each other:

A1 » linked to A2, A3, A4
A2 » linked to A1, A3, A4
A3 » linked to ... 

Mark Segall Community Leader Apr 19, 2022

ok - So I would do a couple things here:

  1. Update your Lookup Issues action so that the query looks something like this:
    1. summary ~ "{{issue.summary}}" AND Key = {{issue}} ORDER BY Key ASC
  2. Create a variable like this to capture the first issue:
    1. {{lookupIssues.get(0).key}}
  3. Perform an advanced branch against {{lookupIssues}}
  4. Perform your linking inside the advanced branch
  5. Add an advanced condition inside the branch where your branch variable equals your oldest variable
  6. Add an issue transition after the advanced condition
Like Tiago Leite likes this

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events