I have automation that runs Lookup work items JQL query and sends result into slack

I want to split issues into chunks of 10 by adding some divider between them:
-------------------------
-------------------------
my problem is I cannot find condition that would work for index inside of #lookupIssues. here's my current code for send slack message step:
Ready for Refinement issues:
{{#lookupIssues}}
https://company.atlassian.net/browse/{{key}} [{{#=}}{{index}} + 1{{/}}] {{summary}}
{{/lookupIssues}}
Total: {{lookupIssues.size}}
then I tried to rely on index to get divider position. this outputs 1 and 0 properly:
{{#=}}{{index}} % 10 == 0 {{/}}
but it doesn't work in if condition:
{{#if(index % 10 == 0 )}}
====================
{{/}}
I tried to make simple condition to render just 1 divider - no output:
{{#if(index == 10)}}
====================
{{/}}
I tried to make simple condition that should be always true. this really confused me because I got no output again:
{{#if(index == 10 || index != 10)}}
====================
{{/}}
I also tried to use IF function but got "Unable to parse expression" error:
{{#=}}
IF(index % 10 = 0, "+++++", "------")
{{/}}
can anyone advice on how do I render something conditionally based on index? and how do I debug this properly? I look into Audit Log but it doesn't give a lot of information when there's no errors