Forums

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

How to filter a list using Assets Object Lookup and break a For Each loop in Jira Automation?

Naman Sogani
July 19, 2026
Hi Community,
I have a list called myList containing multiple objects.
My requirement is:
1. Iterate through each object in myList using a For Each branch.
2. For each item, perform an Assets Object Lookup against a specific Object Type.
3. If the object exists in that Object Type, add it to answerList.
4. If it does not exist, skip it and continue with the next item.
Is there a recommended way in Jira Automation to dynamically build answerList based on the Object Lookup results?

Additionally, I would like to know:
1. Is it possible to exit/break a For Each branch before all iterations are completed?
2. Is there a way to determine how many iterations have been executed in a For Each branch?
For example, if a match is found on the 25th iteration out of 100 items, can the remaining iterations be skipped and can we retrieve the value 25 as the iteration count?
Any guidance or recommended workarounds would be greatly appreciated.
Thanks!

2 answers

1 vote
Trudy P Claspill
Community Champion
July 19, 2026

Hello @Naman Sogani 

Welcome to the Atlassian community.

What are myList and answerList? Are those fields in an issue, an attribute within an object, or something else?

Is the list comprised of objects on one specific Object Type?

How are you intending to do an object lookup for an object from your list such that an object might not be found? Are you using the object from the list to look in another schema, or as a filter for an attribute within another type of object?

It may be possible to accomplish the requirement you described in your first set of questions, but we need more information as I requested in my questions above.

 

Regarding your "Additional questions":

There is not an "exit/break" option for the Branch structure or determine which iteration of the branch is processing. The items being branched over are processed asynchronously and in parallel, not synchronously and sequentially.

Naman Sogani
July 19, 2026

Hi @Trudy P Claspill 

 

Thanks for the follow-up.

myList is a variable that contains the list of objects that automation is receiving from the payload coming via incoming webhook and answerList is a variable that I want to create to store the elements of myList which exists in the concerned objecttype.
"Is the list comprised of objects on one specific Object Type?" Yes I am intending to do an object lookup for an object by its Name in the concerned objecttype
Trudy P Claspill
Community Champion
July 19, 2026

Thank you for that additional information @Naman Sogani 

Your variables are Text, not lists of objects.

Can you provide a sample of the webResponse body that you are getting from your webhook call? We need that to determine the correct syntax for getting the key value from your myList variable.

What information about the "object" is being provided in the response? In order to help you figure out how to lookup the object in Assets we need to know what data you have available to use in that lookup. In Assets each object will have an ID assigned by Assets when the object was created. It is also required to have an attribute identified as it's Label. This is typically applied to the Name attribute. Either of those might be used in your lookup process.

Because branches operate asynchronously and iterations may be run in parallel you can't effectively build up a variable within the iterations of the branch. What is the purpose of your answerList variable? How do you need to use that information?

We will be better able to assist you if you describe the entire problem you are trying to solve versus telling us the specific solution you want to implement.

0 votes
Arkadiusz Wroblewski
Community Champion
July 19, 2026

Hello @Naman Sogani 

Could you confirm how myList is being generated (an Assets field, a JSON array, or a text variable) and whether it contains object keys or just labels?

I would definitely avoid running an Assets lookup inside a For each branch. Automation branches execute in isolation, unable to reliably append data to a shared list variable, and the Create variable action converts list data to a plain string instead of retaining native Assets objects.

A cleaner approach is to filter in one AQL query using an IN statement.

Best,

Arek 🤠 

Naman Sogani
July 19, 2026

Hi @Arkadiusz Wroblewski 

Thanks for the follow-up.
myList is a JSON array. Can you please give me one example of AQL query using an IN statement? 
This is what I am doing inside the branch for each element in the myList

objectType = "XYZObjects" AND XYZID = "{{XYZitem.ID}}"


Suggest an answer

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

Atlassian Community Events