Forums

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

Get position of specific value block in {{webResponse}}

Svante Gustafsson Björkegren
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.
August 16, 2025

Hey community,

I am trying to get one specific element in an array returned in a {{webResponse}} in Automation. I have found the method .get() which requires the number of the position of the element and it works fine. 

The position is different by the runs which means that I need this to be dynamic. My first try was to use a smart value as the position, like:

{{webResponse.body.data.get({{myPosition}})}}

but the get-function does not support smart values like this.

My example is this: I have the following webResponse returned in my automation:

{
"data":
[
{
"id": "A",
"name": "foo"
},
{
"id": "B",
"name": "bar"
},
{
"id": "C",
"name": "baz"
}
]
}

In my automation I now want to get the name attribute for the element having id == "B", i.e. "bar"

Is there a way to get that specific element from the webResponse using any filtering or parsing so that I can use the element in later actions such as:

{{webResponse.body.data."id==B".name}} => "bar"

Looking forward to hear back from you!

Cheers,

// Svante

1 answer

0 votes
Tomislav Tobijas
Community Champion
August 17, 2025

Hey @Svante Gustafsson Björkegren ,

You might want to check this resource: JSON Queries in Jira Automation 

Based on the article above, maybe something like this would work:

  1. Use an "Advanced branching" action on {{webResponse.body.data}}

  2. Inside the branch, add a condition: If {{item.id}} equals "B".

  3. In the "Then" branch, use {{item.name}} (which will be "bar" in your example).

I believe we constructed something like this a while back, but I've lost track of that automation to check it out 😅

Bonus, here's another feature request that might be relevant to the use case: AUTO-1682: Add support for find() and filter() functions in automation smart values 

Cheers,
Tobi

Suggest an answer

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

Atlassian Community Events