Hello all,
I am trying to rearrange the order of Children on a PDF Export, I am using:
{{#each children}} {{fields.summary}} - {{fields.issuetype.name}}
{{/each}}
The idea is that it is coming in the order of newest to oldest. Any workaround to make it show Children the other way around when displaying on EasyPDF.
Any suggestion or help could be good!
Hi @James Rizk
The {{#each children}} block iterates in the order Jira returns child issues, which is typically by creation date (newest first). To reverse this to oldest-first, try the reverse helper.
EasyPDF documentation states it supports 250+ Handlebars helpers, including the generic helpers from the handlebars-helpers library. That library includes a reverse helper for arrays. Try this:
{{#each (reverse children)}}
{{fields.summary}} - {{fields.issuetype.name}}
{{/each}}
If the sub-expression syntax doesn't work, try the block form:
{{#reverse children}}
{{fields.summary}} - {{fields.issuetype.name}}
{{/reverse}}
EasyPDF's generic helpers set may vary by version. If reverse isn't recognized, I'd recommend opening a support request with BOJA Consulting directly through the Marketplace listing — they can confirm which collection helpers are available in your version and may be able to add a sort/reverse option if it's missing.
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can’t reverse the order directly on {{#each children}} because EasyPDF just iterates in the order Jira sends the children – there’s no native reverse or sort helper on that array.
To actually control the order, the workaround is: stop using children and instead loop over a JQL result that is already ordered.
1. Replace children by a JQL helper (if your EasyPDF supports it)
Most EasyPDF / Jira PDF apps have some helper to "repeat issues from a JQL". The exact name varies, but conceptually it goes like this:
{{#each (issues "parent = {{key}} ORDER BY created ASC")}} {{fields.summary}} - {{fields.issuetype.name}} {{/each}}
Key ideas:
parent = {{key}} → gets all children of the current issue.
ORDER BY created ASC → oldest first.
Use DESC if you want to keep "newest to oldest".
The issues helper is just an example name; in some apps it might be jql, searchIssues, etc.
If your "children" are not subtasks but come from a hierarchical field / Portfolio / Advanced Roadmaps, the JQL changes (e.g. issuekey in childIssuesOf("KEY-123") ORDER BY created ASC), but the idea is the same: JQL + ORDER BY + ASC.
2. If the app has a sorting helper
Some implementations expose something like sort/reverse:
{{#each (reverse children)}}
{{fields.summary}} - {{fields.issuetype.name}}
{{/each}}
or
{{#each (sort children "fields.created" "ASC")}}
{{fields.summary}} - {{fields.issuetype.name}}
{{/each}}
But this is not standard. It only works if your version of EasyPDF documents something like this.
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.