Forums

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

Jira automation: smart value variable in processing webhook response

Stefan Walthes
May 13, 2026

Hello community,

I've added a webhook component to my Jira automation flow to gather all sprints (https://jira.hel.kko.ch/rest/agile/1.0/board/18307/sprint)

To process the response and find a specific sprint, I used

{{#webhookResponse.body.values}}{{#if(equals(name,"abc"))}}{{id}}{{/}}{{/}}

which works fine.

Now I want "abc" not hardcoded but as variable or smart value of the issue field "issue.customfield_12919".

But neither

{{#webhookResponse.body.values}}{{#if(equals(name,issue.customfield_12919))}}{{id}}{{/}}{{/}}

nor

{{#webhookResponse.body.values}}{{#if(equals(name,issue.{{customfield_12919}}))}}{{id}}{{/}}{{/}}

nor

{{#webhookResponse.body.values}}{{#if(equals(name,variable))}}{{id}}{{/}}{{/}}

works here.

Without the curly brackets, the code line gives me an empty response. With the curly brackets, the code line gives the error "parameters not closed". Even with the variable, it gives me an empty response.

Any ideas how to pass a smart value or variable in this line of code?

Thx in advance and best regards

Stefan

3 answers

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 Champions.
May 14, 2026

Hi  

When using long-format list iteration, only data from that scope (and lower) is visible.  Thus, outside work item fields, variables, etc. cannot be used.  Worse still, there is a long-standing defect where some functions within an iterator can only interact with the first item in the list, regardless of how many items are present.

There are several workarounds, including:

  • dynamic list searching by flattening the list to text and using dynamic regular expressions
  • For Jira Cloud: a variation of above when only one key / value pair per item is needed (like your scenario), is to Create Dynamic Lookup Table with the data and then use the get() function with the desired key value

To learn more, please see this article I wrote on the topic...including the comments explaining some specific scenarios.

https://community.atlassian.com/forums/Automation-articles/Automation-concepts-Dynamic-searches-within-a-list/ba-p/2834235

 

Kind regards,
Bill

Stefan Walthes
May 15, 2026

Hi Bill,

thx for your hints und your article about this topic. I've read it and it looks like these ideas mentioned in the article could be a workaround for my issue.

Before seeing your ideas, I've done some research and for me the easiest solution currently is to switch to another web service (https://jira.hel.kko.ch/rest/greenhopper/1.0/sprint/picker?query={{issue.customfield_12919.value}}) to get the correct sprint.

So currently I will continue with that but will keep your suggestions in mind.

Thx

Stefan

Like Bill Sheboy likes this
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 Champions.
May 15, 2026

Hi @Stefan Walthes 

FYI I believe the Greenhopper REST API endpoints were deprecated a long time ago, so "buyer beware" when using them as they may disappear without notice.

Kind regards,
Bill

0 votes
Stefan Walthes
May 13, 2026

I've debugged a bit to this and it looks like that variables aren't accessable inside the loop of

{{#webhookResponse.body.values}}

My test (value of customfield_12919 is "abc"):

variable = issue.customfield_12919

{{equals(variable, "abc")}} gives me true.

{{#webhookResponse.body.values}} {{equals(variable, "abc")}} {{/}} gives me false.

It is the same line of code, just inside the loop of my webhook response array. And when inside the loop, "variable" seems not to be accessable.

I've also tried with "vars.variable" to explicit use it in global context.

Stefan Walthes
May 13, 2026

maybe this corresponds to https://jira.atlassian.com/browse/AUTO-239 ?

0 votes
Marc -Devoteam-
Community Champion
May 13, 2026

Hi @Stefan Walthes 

Welcome to the community.

What is the name of the custom field?

It should be like: {{#webhookResponse.body.values}}{{#if(equals(name,issue.<name of field>))}}{{id}}{{/}}{{/}}

So as example: {{#webhookResponse.body.values}}{{#if(equals(name,reporter.displayName))}}{{id}}{{/}}{{/}}

Stefan Walthes
May 13, 2026

Hi Marc,

the name of the custom field is "customfield_12919".

I've already tried

{{#webhookResponse.body.values}}{{#if(equals(name,issue.customfield_12919))}}{{id}}{{/}}{{/}}

without success.

Best regards

Stefan 

Marc -Devoteam-
Community Champion
May 13, 2026

Hi @Stefan Walthes 

No this "customfield_12919" is the ID not the name of the field.

What is the name of the field on the issue itself?

Stefan Walthes
May 13, 2026

The name of this field is "Major Release".

Do I have to put the name in the code line instead of the id or variable?

Please have a look at my other findings, especially that this could be related to https://jira.atlassian.com/browse/AUTO-239

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events