LookupIssues and if statements

David Loszewski
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 21, 2025

Having difficulty with filtering through lookupIssues with if statements, I have it running through an advanced branch so it will look at every result and will write to the audit log depending on whether the issue key from the lookupissues list is CUS or CDI.  The problem is that it will match correctly on the first if statement but will never match on the second if statement.  If I reverse the order and place "contains CUS" as the first if statement, it will match on that one and then not match on the other.  Any ideas why and how to fix this? Based on this particular case it "should" match on both. 

Screenshot 2025-01-21 134751.pngScreenshot 2025-01-21 135553.png

 

2 answers

1 accepted

1 vote
Answer accepted
David Loszewski
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 21, 2025

Found a workaround by modifying the JQL and assigning to individual variables. 

0 votes
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 21, 2025

Hi @David Loszewski 

Your created variable {{atVAR}} apparently contains:

CDI-94, CUS-39

And that is used in a dynamic JQL expression for the Lookup Issues action:

issue IN linkedIssues({{atVAR}}, "Child of")

However, the linkedIssues function only takes one issue as a parameter, optionally followed by a list of link types: https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#linkedIssues--

 

What do you want that lookup to find?  For example, if you wanted the linked "Child of" issues for both, you could make the JQL more dynamic with list iteration:

{{#atVAR.split(", ")}}
( issue IN linkedIssues( {{.}}, "Child of" ) ) {{^last}} OR {{/}}
{{/}}

 

Kind regards,
Bill

David Loszewski
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 21, 2025

I want it to find all issue links of {{atVAR}} which I believe it's doing, in this case being CDI-94 and CUS-39.

I thought using the advanced branch I could loop through each of the lookup results.  

David Loszewski
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 21, 2025

a screenshot of the advanced branch Screenshot 2025-01-21 145435.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 21, 2025

When you want to loop through the issues, use a Branch on JQL instead of the Lookup Issues action.

David Loszewski
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 21, 2025

odd enough I'm showing the same behavior when I move it to a JQL branch instead. 

Screenshot 2025-01-21 151936.png

David Loszewski
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 21, 2025

btw, {{atVAR}} only contains one issue, AT-85.   So it is only passing one parameter.  The CDI-94 and CUS-39 are the results 

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