How to iterate through lookupIssues to set a variable?

Nicholas Tsiroyiannis
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 20, 2023

Hello All, 

I would like to iterate through lookupIssues using conditional logic and set a variable with the result.

The lookupIssues have a field called overallStatus, and the logic is straightforward

If any of the lookupIssues.overallStatus have a value of X, then the variable should be set to X

if any of the lookupIssues.overallStatus have a value of Y, then the variable should be set to Y

I assume the logic has to go in the smart value of the create variable action, but I am stuck!

Any ideas ?

 

Screenshot 2023-10-20 at 17.00.34.png

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 20, 2023

Hello @Nicholas Tsiroyiannis

What I would recommend instead is using two Lookup Issue actions and two variables.

In the first Lookup Issues action change the JQL to look for only the issues that have overallStatus set to X.

Create a variable called overallStatusXCount and set it to {{lookupIssues.size|0}}

In the second Lookup Issues action change the JQL to look for only the issues that have overallStatus set to Y.

Create a variable called overallStatusYCount and set it to {{lookupIssues.size|0}}

The you can use those two variables in Condition actions to determine what to do next.

Nicholas Tsiroyiannis
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 27, 2023

thank you Trudy, I will give it a try :)

Suggest an answer

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

Atlassian Community Events