The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Trudy P Claspill
Community Champion
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 :)

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events