Forums

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

How can I reference a specific index in an automation lookup?

Brock Jolet
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.
October 25, 2021

I've got a very simple query that I'm using in a Lookup step of an automation that returns Epic issues with a specific label.

project = Finance AND type = Epic AND labels = month ORDER BY created DESC

I would like to reference only the most recent Epic, which should be the first result.

I can't figure out how to do an index search. The following returns nothing.

{{#lookupIssues}} {{key.get(1)}} {{/}}

 

Alternately, if there is a way to alter my query to only return one result, that should work too.

1 answer

1 accepted

4 votes
Answer accepted
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.
October 25, 2021

Hi @Brock Jolet 

No way to return TOP 1 as JQL isn't a SQL.  Please try:

{{lookupIssues.first.key}}  or  {{lookupIssues.get(0).key}}  (Lists use 0-based arrays, I think.)

Kind regards,
Bill

Brock Jolet
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.
October 25, 2021

{{lookupIssues.first.key}} worked perfectly!

Thanks, @Bill Sheboy !

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events