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.