Xporter for JIRA - for loop error

When exporting a template on a sub-task, to get the parent task's due date, I get the following error:

We are sorry, an unexpected error hasnoccured in the export of your issue.

Please provide the information below to our support.

General Exception:
java.lang.StringIndexOutOfBoundsException: String index out of range: -180
String index out of range: -180
com.xpandit.jiraxporter.exporter.callbacks.j.replacing(Unknown Source)

It goes on for a few pages.

The following snippet appears to be the problem:

#{for i=JQLIssuesCount|clause=issuekey = ${ParentIssueKey}}

If I run the export without this snippet, the template is fine. If I add this, it produces the above error message.

I tried with another for loop as suggested in the documentation #{for comments}${Comments[n].Author} #{end}, and also hand typing the above query, to ensure there were no invisible characters, but the results are the same.


Running JIRA SD 3.2.6/JIRA Core 7.2.6 and Xporter 4.3.1.

Has anyone seen anything similar/is there another way to get the parent issue due date?

1 answer

This widget could not be displayed.

OK, so I've determined that you can't have the #for loop mid-sentence. For context, it was in the middle of a paragraph:

You should therefore expect a response from us by  #{for i=JQLIssuesCount|clause=issuekey = ${ParentIssueKey}}


#{end}. The consultation period may be extended....

EDIT: So this is my workaround:

#{for i=JQLIssuesCount|clause=issuekey = ${ParentIssueKey}}You should therefore expect a response from us by ${dateformat("d MMMM yyyy"):JQLIssues[i].DueDate}#{end}. The consultation period may be extended...

Peculiar that I can add text after the #{end}, but not before the #{for...

Hi @Jimmy Van,

Could open a ticket in our Support Portal in order to share your template with us? We need analyse what's happening


Rui Rodrigues.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 12 hours ago in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

39 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you