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
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.
maybe this corresponds to https://jira.atlassian.com/browse/AUTO-239 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}}{{/}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No this "customfield_12919" is the ID not the name of the field.
What is the name of the field on the issue itself?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.