---
title: "Exercise 4 - Populating the Comments Inside JQL Queries"
canonical: "https://docs.getxporter.app/space/XPORTERCLOUD/559729/Exercise%204%20-%20Populating%20the%20Comments%20Inside%20JQL%20Queries"
format: markdown
---
> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> > Macro (toc)

# Introduction

In this exercise, you'll learn how to export comments inside of [JQL Queries](https://docs.getxporter.app/space/XPORTERCLOUD/527003). This is called a *nested iteration*.

We will use the clause created in [Exercise 3](https://docs.getxporter.app/space/XPORTERCLOUD/559729/Exercise+4+-+How+to+Populate+the+Comments+Inside+JQL+Queries), but adding an ordering parameter.

# Populating the Comments Inside JQL Queries

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> You will iterate over *JQLIssuesCount*, <span style="color: #0d0d0d">and within that iteration, another iteration will print the comments of all JQL Issues that meet the specified clause.</span>
> 
> > Macro (rw-step)
> 
> By using the clause, you can specify the order of your issues. In this example, it is ordered by *Key ASC* (ascending).
> 
> 
> ```
> #{for i=JQLIssuesCount|clause=project = ACADEMY order by Key ASC}
>    Key: ${JQLIssues[i].Key}
>    Summary: ${JQLIssues[i].Summary}
> #{for a=JQLIssues[i].CommentsCount}
>   	 Comment %{${a}+1}: ${JQLIssues[i].Comments[a].Body}
> #{end}
> #{end}
> ```
> 
> > ⚠️ If an Issue has no comments, then no comments will be printed for that Issue.
> 
> > Macro (rw-step)
> 
> While in this case, we've used the iteration "comments" to populate inside JQL Issues, you can populate with other iterations using the same process.
> 
> These iterations represent only a small subset of [all available iterations](https://docs.getxporter.app/space/XPORTERCLOUD/428318/Iterations).
> 
> ## Examples
> 
> Below (Figure 1) is a sample of how the [mappings](https://docs.getxporter.app/space/XPORTERCLOUD/558575) will be displayed in an [Excel template](https://docs.getxporter.app/space/XPORTERCLOUD/558471).
> 
> ![Figure 1 - Excel template](media://23b4e928-92e6-4d63-aca5-fb5388144a8f)
> 
> This Template (Figure 1) includes:
> 
> - A header with a logo (Figure 1 - 1).
> - A static section iteration (Figure 1 - 3).
> - Headings (Figure 1 - 2).
> - Text styling (Figure 1 - 4).
> 
> Below (Figure 2) is a sample of how the generated file will be populated.
> 
> ![Figure 2 - Populated file](media://543dc516-cdf4-4c8d-a874-c4e673284271)


> ℹ️ **This exercise is now complete. Proceed to **[**Exercise **](https://docs.getxporter.app/space/XPORTERCLOUD/559654/Exercise+5+-+How+to+Populate+Set+Functions)<span style="color: #0055cc">[**5**](https://docs.getxporter.app/space/XPORTERCLOUD/559654/Exercise+5+-+How+to+Populate+Set+Functions)</span>** to learn h****ow to populate set functions.**
> ℹ️ 
> ℹ️ If you like this exercise, please leave a comment or a 👍. Your feedback is very important to us.
> ℹ️ 
> ℹ️ Thank you in advance. Enjoy our product!

<details>
<summary>Exercise 4 Resources</summary>

| **File** | **Description** |
| --- | --- |
|  | **Exercise 4 -** Sample Template file |
|  | **Exercise 4 -** Sample generated file |
</details>


<details>
<summary>Support/Troubleshooting</summary>

If you have questions or technical issues, please [contact the Support team via the Customer Portal (Jira service management)](https://jira.getxray.app/servicedesk/customer/portal/2/user/login?destination=portal%2F2%2Fcreate%2F28) or [send us a message using the in-app chat](https://docs.getxporter.app/space/XPORTERCLOUD/18251779/In-App+Chat+Support).
</details>