I need to filter on issuetype.name=‘Epic’ and add another #each block inside to search for all tickets that have as parent the Epic found in the first #each. If I filter before passing that to the visualizer, I won’t have access to all the tickets.
I’ve tried using a #if after the #each but it get the error Missing helper.
You can still do all of the filtering for what you need using javascript in the tests section before passing that data to the visualizer.
The use of handlebars in the visualizer is limited in the sandbox, it’s not the full version of the library so it would have the same capability as you would give in the standalone version.
I have to use a #each block for the “Epic” and for each “Epic” I have to get the “Requirements” whose parent is the current “Epic”. Something like that:
{{#each response}} 'Epic
<tr>
<td>EPIC</td>
<td>{{key}}</td>
<td>{{id}}</td>
</tr>
{{#each response}} 'Requirements whose parent is the current Epic
<tr>
<td></td>
<td>{{key}}</td>
<td>{{id}}</td>
</tr>
{{/each}}
{{/each}}
The main problem here is that you have an array of objects, but not all of the objects have the same keys.
My recommendation would be to filter for the Epics first, so you have a list of Epics.
Then filter the response for those Epics, but this would need to be done by looping through each object in the response, as the JavaScript find\filter method will error as it will produce a fatal error with the objects missing the relevant keys.
You need to use a method that won’t error if the key doesn’t exist.
If you create a blank array, You can then make a new object with just the epic, id and key, and then push it to the array during the inner loop.
You can then use this array for the Visualizer.
The following seems to work against your example response.