Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,333
Community Members
 
Community Events
176
Community Groups

Xporter JQL / populate Word document with variable from another issue and another issuetype

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.

 

1 answer

Hi @Yannick Philippets 

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]

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events