Iterating Issue Comments
Because it is not known in advance how many comments exist for an issue, you can iterate a section over all the comments on an issue. This allows you to create a table that dynamically grows according to the number of existing comments. The notation is:
Comments Fields | Description |
---|---|
Author | The author of the comment |
AuthorFullName | The full name of the author of the comment |
Body | The comment |
Created | The date the comment was posted |
GroupLevel | The group level of the comment |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue comments.
Iterating Issue Worklogs
Because it is not known in advance how many work logs exist for an issue, you can iterate a section over all the work logs of an issue. This allows you to create a table that dynamically grows according to the number of existing worklogs. The notation is:
Worklogs Fields | Description |
---|---|
Author | The author of the worklog |
AuthorFullName | The full name of the author of the worklog |
Comment | The comment of the worklog |
Created | The date the worklog was created |
Date Started | The date the worklog was started |
Time Spent | The time spent in seconds |
TimeSpentFormatted | The time spent as displayed on Jira |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue worklogs.
Iterating Issue Components
Because it is not known in advance how many components exist for an issue, you can iterate a section over all the components of an issue. This allows you to create a table that dynamically grows according to the number of existing components. The notation is:
Components Fields | Description |
---|---|
Name | The name of the component |
Description | The description of the component |
Lead | The name of the component lead |
Id | The ID of the component |
ProjectId | The project ID of the component |
AssigneeType | The assignee type of the component |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue components.
Iterating_Issue_Components.docx
Iterating_Issue_Components.xlsx
Iterating Issue Status Transitions
Because it is not known in advance how many Status Transitions exist for an issue, you can iterate a section over all the Status Transitions of an issue. This allows you to create a table that dynamically grows according to the number of existing status transitions. The notation is:
Status Transitions Fields | Description |
---|---|
Author | The author of the status transition |
Created | The date the status transition was performed |
OldStatus | The old status of the status transition |
NewStatus | The new status of the status transition |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue status transitions.
Iterations_StatusTransitions.docx
Iterations_StatusTransitions.xlsx
Iterating Issue Attached Images
Because it is not known in advance how many Images can exist for an issue (as an attachment), you can iterate a section over all the attached images of an issue to get some metadata about them. This allows you to create a table that dynamically grows according to the number of existing images. The notation is:
Attachments Images Fields | Description |
---|---|
ID | The ID of the attached image |
Image | The image of the attached image |
Name | The name of the attached image |
Size | The size of the attached image |
HumanReadableSize | The size of the attached image |
Author | The author of the attached image |
Created | The date the attached image was created |
MimeType | The type of the attached image |
ThumbnailURL | The image thumbnail URL. |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue attached images.
Iterations_AttachedImages.docx
Iterations_AttachedImages.xlsx
Document Generator will automatically read the EXIF orientation property of an image and rotate it to its correct orientation. You can turn this off by adding ${prop(xporter.images.process.exif,
true
/
false
)}
to your template.
You can use the mappings "width" and "height" to define the exact width and height of the printed image.
These values are in pixels and if you only define one of them the image will be rescaled.
Note that, if you use both maxWidth and width mappings, only the max value will be read. The same behavior happens with height and maxHeight.
Iterating Issue Attachments
Because it is not known in advance how many attachments exist in an issue, you can iterate a section over all the attachments of an issue. This allows you to create a table that dynamically grows according to the number of existing attachments. The notation is:
Attachments Fields | Description |
---|---|
ID | The ID of the attachment |
Name | The name of the attachment |
Author | The author of the attachment |
AuthorFullName | The full name of the author of the attachment |
Created | The date the attachment was created |
Size | The size of the attachment |
HumanReadableSize | The formatted size of the attachment |
MimeType | The type of attachment |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue attachments.
Iterating Issue Labels
Because it is not known in advance how many labels exist in an issue, you can iterate a section over all the labels of an issue. The notation is:
Attachments Fields | Description |
---|---|
Name | The name of the label |
#{for labels} ${Labels[n].Name} #{end} or #{for <VariableName>=LabelsCount} ${Labels[VariableName].Name} #{end}
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue comments.
Iterating Fix Versions of an Issue
You can iterate over all fix versions to which the issue belong to. The notation is:
Versions Fields | Description |
---|---|
Name | The version name |
Description | The version description |
Start date | Starting date of the version |
Release date | Release date of the version |
Archived | Boolean that indicates if the version is archived or not |
Released | Boolean that indicates if the version is released or not |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue fix versions.
Iterating_Issue_FixVersions.docx
Iterating_Issue_FixVersions.xlsx
Iterating Affected Versions of an Issue
You can iterate over all affected versions to which the issue belong to. The notation is:
Versions Fields | Description |
---|---|
Name | The version name |
Description | The version description |
Start date | Starting date of the version |
Release date | Release date of the version |
Archived | Boolean that indicates if the version is archived or not |
Released | Boolean that indicates if the version is released or not |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue affected versions.
Iterating_Issue_AffectedVersions.docx
Iterating_Issue_AffectedVersions.xlsx
Iterating Project Versions
You can iterate over all project versions to which the issue belong to. The notation is:
Project Versions Fields | Description |
---|---|
Name | The version name |
Description | The version description |
Start date | Starting date of the version |
Release date | Release date of the version |
Archived | Boolean that indicates if the version is archived or not |
Released | Boolean that indicates if the version is released or not |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue project versions.
Iterations_ProjectVersions.docx
Iterations_ProjectVersions.xlsx
Iterating Issue Links
Because it is not known in advance how many linked issues exist for an issue, you can iterate a section over all the linked issues of an issue. This allows you to create a table that dynamically grows according to the number of existing linked issues. The notation is:
Links Fields | Description |
---|---|
LinkType | The type of the link |
Key | The key of the linked issue |
Summary | The summary of the linked issue |
URL | The URL of the link |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue links.
Iterating Issue Subtasks
Because it is not known in advance how many subtasks exist for an issue, you can iterate a section over all the subtasks of an issue. This allows you to create a table that dynamically grows according to the number of existing subtasks. The notation is:
Subtasks Fields | Description |
---|---|
Key | The key of the subtasks |
Summary | The summary of the subtasks |
AssigneeUserDisplayName | The assignee user of the subtasks |
The documents below demonstrate examples both in Word and Excel template that iterates over all the issue subtasks.
Iterating Issues In Epic
All fields listed here are available on IssuesInEpic[n] because they represent an issue.
Because it is not known in advance how many issues exist for an epic, you can iterate a section over all the issues of an epic issue. This allows you to create a table that dynamically grows according to the number of existing issues. The notation is:
The documents below demonstrate examples both in Word and Excel template that iterates over the issues in epic.
Iterating Project Components
You can iterate over all project components. The notation is:
The documents below demonstrate examples both in Word and Excel template that iterates over the project components.
Iterating_Issue_ProjectComponents.docx
Iterating_Issue_ProjectComponents.xlsx
Applying filters to Iterations
If you want to take the previous iterations over comments, subtasks, and issue links to another level of control, you can use a JavaScript filter to define over which issues the iteration will be made. This can be useful in the following scenarios:
- Iterating over linked issues that are only of a specific issue type
- Iterating over subtasks of a specific issue type
- Iterating over linked issues with a specific priority
- Iterating over comments created by a specific user
The notation for applying filters to the iterations is:
- VariableName is the name of the variable to use as the iteration index.
LinksCount|SubtasksCount|CommentsCount indicates over which type of entities you want to iterate.
- Filter indicates the filter to be applied in the iteration.
Notice that as the filter is evaluated as a JavaScript expression, which provides flexibility in the definition of the conditions. You can use and (&&), or (||) and other logical operators supported by the JavaScript language.
It is also possible to format fields inside iteration filters.
The documents below demonstrate examples of a templates that iterate over issue links and comments with filters being applied.
Links Bugs with High Priority:
Nested Iterations:
Links_with_nested_Iterations.docx
Links_with_nested_Iterations.xlsx
For a working example of this functionality, check the template Sample Iterations in the Template Store.
Iterating in the same line of the document
You can also possible to iterate values in the same line of the document. This can be useful if you want to display a list of Subtasks on Linked Issues in the same line, separated by commas or spaces.
Iterating in the same cell in an Excel document
You can also iterate values in the same cell in an Excel document. You can achieve this by simply making your Iteration inside the same cell.
You can use all the Iterations that you are used to and construct them in the exact same way, the difference being that you only use one cell to do them.
Iterating with the BREAK or CONTINUE statement
You can iterate anything, set up a Conditional expression and then utilize the BREAK and CONTINUE statements.
The way to do this is by doing a normal Conditional expression and using the mapping #{break} or #{continue} inside it.
Sorting iterations
Imagine that you have an iteration and want to sort it by any field that it can export normally. This will be the header for such an iteration:
#{for comments|sortby=<Iteration mapping>} |
NOTE: The mapping after the "sortby" must be equal to the supported mappings for each Iteration.
Example:
Sort By Bulk export
The sortby can also be used to sort a &{for issues} iteration on a Bulk Export.
Sorting Criteria
asc and desc can be defined in order to define how do you want to sort your data. The default value is asc.