Forums

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

Can't loop through GET Web Response. Even though it's an array of JSONs

Nathan Hutchins May 2, 2025

I am making a Global automation rule that runs whenever a Version is updated in a specific project. The goal is that this automation will find any other Version with the same name in other projects and update them to match.

Since there is no Version query within Automations I've decided to run a Get request on each project I want to search and get a list of their versions. 

When I attempt to loop through this response with a For each: Smart value; it doesn't loop through each item individually. Rather it just returns it all as one large JSON. 

How can I loop through a Web Response that is an array of JSONs? 

E.g. My Automation with full url redacted.

The audit log step only ever logs the FULL array of JSONs. I can never access just the {{myIterator.name}} value.
Screenshot 2025-05-02 at 1.14.17 PM.png


If there is an easier way to sync updates from one Version across projects I'd be happy to know.

 

1 answer

1 accepted

2 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.
May 2, 2025

Hi @Nathan Hutchins 

First, I do not believe there is a REST API endpoint to get all the versions for all of the projects.  Instead, you may get all the versions for a single project, and that is the endpoint you appear to be using:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-project-projectidorkey-version-get

 

Next, without seeing the specifics of your advanced branch (specifically, the smart value expression) it is difficult to know why the rule is not iterating over a list of values.

 

Finally, back to your apparent scenario:

GIVEN a version named "123" in Project ABC
AND there are other versions named "123" in other projects
WHEN version "123" in Project ABC is updated
THEN do something to the versions with the same name in the other projects

To do this with an automation rule, I believe you could instead:

  • use an advanced branch over the Project list,
  • make a call to the REST API endpoint for each project, passing the version name as the query parameter (and probably including other parameters such as status, orderBy, etc.)
  • use conditions to evaluate if it was found
  • do something when found (This may need to use the REST API endpoints as the rule will already be inside of a branch on the project keys.)

 

Kind regards,
Bill

Nathan Hutchins May 5, 2025

Hi Bill, thanks for the response! Changing to looping through projects and adding the version name to the query helped make the automation easier. 

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