Hi,
I am trying to use automation in JIRA Data Center (Software + Service Management) to fill an issue field from a list of templates depending on the request type. The list is fetched via REST call and is returned as a list of json objects.
The id to look for is derived from issue properties and written into an automation variable.
Iterating over the list works fine, as does accessing the variable value outside the list processing.
When I try to access the variable (or any other smart value) inside the list processing loop, it only returns an empty value, so the check for the required template fails.
For test purposes I just try to write the values into the issue description using the Edit Issue action:
Request: {{requestType}}
Issue key: {{issue.key}}
{{#webhookResponse.body.templates}}
Request: {{requestType}}
Issue key: {{issue.key}}
Name: {{name}}
{{#if(equals(name, requestType))}}
Matched
{{value}}
{{/}}
{{/}}}This results in a description like this:
Request: Template 3
Issue key: TEST-9876
Request:
Issue key:
Name: Template 1
Request:
Issue key:
Name: Template 2
Request:
Issue key:
Name: Template 3
Request:
Issue key:
Name: Template 4
How can I access the global values inside the list?