Hi everyone,
To present my expectations : I launch the export from an issue "Issue1" of type "MyIssueType" to a Word document, and I need some informations (an address) contained in another issue which depends on the country completed in a field of "Issue1". I have a set of issues used as templates (one template per country), whose name is like "MyTemplate_Country" (i.e. "MyTemplate_France", "MyTemplate_US", ...), of another type "TemplateAddress".
Here below my Word template, where ${Summary}, ${IdCountry} and ${Name} come from fields from "Issue1", and ${JQLIssues[i].IdCountry} and ${JQLIssues[i].Address} come from fields on the right "MyTemplate_Country" :
----------------
#{for i=JQLIssuesCount|clause=project = "MyProject" AND summary ~ "MyTemplate_" AND issuetype = TemplateAddress}
#{if (%{'${IdCountry}'.equals('${JQLIssues[i].IdCountry}')})}
Title: ${Summary}
Name: ${Name}
Address : ${JQLIssues[i].Address}
#{end}
#{end}
----------------
This JQL query works very well if "MyTemplate_Country" and "Issue 1" have the same issuetype. But as soon as I use the "TemplateAddress" type, the query fails and no template is found...
Do you know where the problem would be please ?
Thanks by advance,
Yannick.
I am not sure if I fully understood the organization that you have, however it should be related to this condition:
#{if (%{'${IdCountry}'.equals('${JQLIssues[i].IdCountry}')})}
And the JQL query:
#{for i=JQLIssuesCount|clause=project = "MyProject" AND summary ~ "MyTemplate_" AND issuetype = TemplateAddress}
In this condition, you compare the country of the current issue with the country of the issue returned from the JQL query. So if the JQL returned values don't match the country in the current issue, it would not return any value.
I would suggest to print the issue keys and the country id to debug this. Add something like this to your template:
${Key} ${IdCountry}
${JQLIssues[i].Key} ${JQLIssues[i].IdCountry}
By comparing the values, you should be able to check what is failing.
Thank you.
Kind regards,
Rogério Paiva [Xporter Support Team]
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.