Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
UI Expand
titleTable of Contents

Table of Contents

Iterating Issue

...

History

Changes to issues Issues are registered in the Issue ActivityHistory, but it is not known in advance how many changes are going to be made

The History tab shows the following Issue’s operations/updates:

  • Changing the Test Type.
  • Changing the Test Definition or Steps.
  • Linking the Test with other entities (Preconditions, Test Plans, Test Sets, etc.).
  • Moving the Test between folders on the Test Repository.
  • Attachment addition.
  • Test Execution.

You can iterate a section over all the activities History entries of an issueIssue. This allows you to create a table that dynamically grows according to the number of existing activitieschanges done. 

The notation is:

Activity FieldsTitle title the issueSummary summary of the activityWhen an activity regards an Issue Status change, this field displays the new Issue Status

Field

Description

HistoryEntriesCountThe
number of
changes made
AuthorThe
ContentWhen an activity involves a change in the Issue contents, this field displays the new contents
AuthorThe author of the activity
AuthorEmailThe email of the author of the activity
PublishedThe time the issue was published
UpdatedThe time the issue was updated
Categories
user who made the change
CreatedDate of the change
ChangedItemsCountThe number of fields changed in the current change
ChangedItems

Field

Description

FieldReturns the name of the field in which the value was changed
FromReturns the old value
ToReturns the new value
Code Block
titleExpand to see the sample code
collapsetrue
#{for activityEntrieshistoryEntries}
   ${ActivityEntriesfullname:HistoryEntries[n].TitleAuthor}
 made changes ${ActivityEntriesdateformat("dd-MM-yyyy HH:mm:ss"):HistoryEntries[n].SummaryCreated}
   ${ActivityEntries#{for ch=HistoryEntries[n].ContentChangedItemsCount}
    Field Name: ${ActivityEntriesHistoryEntries[n].AuthorChangedItems[ch].Field}
    Old Value:  ${ActivityEntriesHistoryEntries[n].ChangedItems[ch].AuthorEmailFrom}
    New Value:  ${dateformat("dd-MM-yyyy HH:mm:ss"):ActivityEntries[n].PublishedHistoryEntries[n].ChangedItems[ch].To}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):ActivityEntries[n].Updated}
   ${ActivityEntries[n].Categories}
#{end}
#{end}
  
or
   
#{for <VariableName>=ActivityEntriesCountHistoryEntriesCount}
   Content and Issue History Mappings. Example: ${ActivityEntriesfullname:HistoryEntries[VariableName].Field}
#{end}
Info

We suggest that you use the html function to render the data because almost all content is HTML, e.g., ${html:ActivityEntries[n].Title}

Below is an example of using the Activity iteration in a Word template:

Image Removed

or

Image Removed

Below is an example of using the Activity iteration in an Excel template:

Image Removed

or

Image Removed

Iterating Issue Comments

The documents below demonstrate examples both in Word and Excel templates that iterate over all the Issue comments.

Iterating_Issue_History.docx

Iterating_Issue_History.xlsx

...

Iterating Xray Issue History

Changes related to Xray fields in Xray Issues are registered in a separate tab named Xray History, as changes to these fields can not be included with the Issue changes. For this reason, there is another way of iterating Xray history changes. Just like with Issue changesBecause it is not known in advance how many comments exist for an issue, you can iterate a section over all the comments on an issueXray history entries of an Issue. This allows you to create a table that dynamically grows according to the number of existing commentschanges done.

The notation is:

Comments FieldsAuthor author the commentAuthorFullName full name of the author of the comment

Field

Description

XrayHistoryEntriesCountThe
number of
changes made
ActionThe
BodyThe comment
CreatedThe date the comment was posted
GroupLevelThe group level of the comment
action that originated the changes
UserThe user who made the change
DateDate of the change
VersionThe Xray Test Version where the changes were made (if applicable)
XrayChangedItemsCountThe number of fields changed in the current change
XrayChangedItems

Field

Description

FieldThe name of the field in which the value was changed
ChangesThe changes for the field (old and new value)
Code Block
Code Block
titleExpand to see the sample code
collapsetrue
#{for commentsXrayHistoryEntries}
   ${Commentsfullname:XrayHistoryEntries[n].AuthorUser} 
made changes  ${Commentsdateformat("dd-MM-yyyy HH:mm:ss"):XrayHistoryEntries[n].AuthorFullNameDate} 
   ${Comments#{for ch=XrayHistoryEntries[n].BodyXrayChangedItemsCount}
  
  Field ${dateformat("dd-MM-yyyy HH:mm:ss"):CommentsName: ${XrayHistoryEntries[n].CreatedXrayChangedItems[ch].Field}
    Changes:  ${CommentsXrayHistoryEntries[n].GroupLevelXrayChangedItems[ch].Changes}
  #{end}
#{end}
   
or
   
#{for <VariableName>=CommentsCountXrayHistoryEntriesCount}
   Content and Xray Issue History Mappings. Example: ${Commentsfullname:XrayHistoryEntries[VariableName].Field}
#{end}

The image below demonstrates an example of a Word template that iterates over issue comments.

Image Removed

or

Image Removed

The image below demonstrates an example of an Excel template that iterates over issue comments.

Image Removed

or

Image Removed

The documents below demonstrate examples both in Word and Excel templates that iterate over all the Issue comments.

Iterating_Xray_Issue_History.docx

Iterating_Xray_Issue_History.xlsx

...

Iterating Issue Comments

...

Because it is not known in advance how many work logs comments exist for an issueIssue, you can iterate a section over all the work logs of an issuecomments on an Issue. This allows you to create a table that dynamically grows according to the number of existing worklogscomments.

The notation is:

Worklogs worklog worklogComment of the worklog worklog created
Comments FieldsDescription
Author

The author of the

comment

AuthorFullNameThe full name of the author of the comment
BodyThe comment
CreatedThe date the comment was posted
Date StartedGroupLevelThe date the worklog was started

Time Spent

The time spent in seconds

TimeSpentFormatted

The time spent as displayed on Jira
BillableSecondsThe billable seconds (Belongs to Tempo Timesheets plugin)
group level of the comment
Code Block
titleExpand
Code Block
titleExpand to see the sample code
collapsetrue
#{for worklogscomments}
   ${WorklogsComments[n].Author} 
   ${WorklogsComments[n].AuthorFullName}  
   ${WorklogsComments[n].CommentBody} 
   ${dateformat("dd-MM-yyyy HH:mm:ss"):WorklogsComments[n].Created}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):WorklogsComments[n].Date StartedGroupLevel} 
   ${Worklogs[n].Time Spent}
   ${Worklogs[n].TimeSpentFormatted} 
#{end}
  
or
  
#{for <VariableName>=WorklogsCountCommentsCount}
   Content and WorklogIssue Mappings. Example: ${WorklogsComments[VariableName].Field}
#{end}

The

...

documents below demonstrate examples both in Word and Excel templates that iterate over all the Issue comments.

Iterations_Comments.docx

Iterations_Comments.xlsx

...

Iterating Issue Worklogs

Image Removed

or

Image Removed

The image below demonstrates an example of a template in Excel that iterates over issue work logs.

Image Removed

or

...

Because it is not known in advance how many components worklogs exist for an issueIssue, you can iterate a section over all the components work logs of an issueIssue. This allows you to create a table that dynamically grows according to the number of existing componentsworklogs.

The notation is:

The assignee type of the component
Components

Worklogs Fields

Description

Name

Author

The

name

author of the

component

worklog

Description

AuthorFullName

The

description

full name of the

component

author of the worklog

Comment

Lead

The

name

comment of the

component lead

worklog

Id

Created

The

ID of the component
ProjectIdThe project ID of the component

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 JiraAssigneeType
Code Block
titleExpand to see the sample code
collapsetrue
#{for componentsworklogs}
   ${ComponentsWorklogs[n].NameAuthor} 
   ${ComponentsWorklogs[n].DescriptionAuthorFullName} 
   ${fullname:ComponentsWorklogs[n].LeadComment}
   ${Componentsdateformat("dd-MM-yyyy HH:mm:ss"):Worklogs[n].IdCreated}
   ${Components[n].ProjectIddateformat("dd-MM-yyyy HH:mm:ss"):Worklogs[n].Date Started} 
   ${Worklogs[n].Time Spent}
   ${ComponentsWorklogs[n].AssigneeTypeTimeSpentFormatted} 
#{end}
 
or
 
#{for <VariableName>=WorklogsCount}
   Content and Worklog Mappings. Example: ${Worklogs[VariableName].Field}
#{end}

 The  image below demonstrates an example of a Word template that iterates over issue components.

Image Removed

 The image below demonstrates an example of an Excel template that iterates over issue components.

 Image Removed

documents below demonstrate examples both in Word and Excel templates that iterate over all the Issue worklogs.

Iterations_Worklogs.docx

Iterations_Worklogs.xlsx

...

Iterating Issue Components

...

Because it is not known in advance how many Status Transitions components exist for an issueIssue, you can iterate a section over all the Status Transitions components of an issueIssue. This allows you to create a table that dynamically grows according to the number of existing status transitionscomponents. 

The notation is:

Status Transitions Components FieldsDescription
AuthorNameThe author name of the status transitioncomponent
CreatedDescriptionThe date the status transition was performed
OldStatusThe old status of the status transition
NewStatusThe new status of the status transition
description of the component
LeadThe name of the component lead
IdThe ID of the component
ProjectIdThe project ID of the component
AssigneeTypeThe assignee type of the component
Code Block
title
Code Block
titleExpand to see the sample code
collapsetrue
#{for statusTransitionscomponents}
   ${StatusTransitionsComponents[n].AuthorName}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):StatusTransitionsComponents[n].CreatedDescription}
   ${StatusTransitionsfullname:Components[n].OldStatusLead}
   ${StatusTransitionsComponents[n].NewStatusId}
#{end}
 
or
 
#{for <VariableName>=StatusTransitionsCount}
   Content and StatusTransitions Mappings. Example: ${StatusTransitions[VariableName].Field   ${Components[n].ProjectId}
   ${Components[n].AssigneeType}
#{end}

The image below demonstrates an example of a Word template that iterates over status transitions.

Image Removed

or

Image Removed

The image below demonstrates an example of an Excel template that iterates over status transitions.

Image Removed

or

Image Removed

The documents below demonstrate examples both in Word and Excel templates that iterate 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 Images can Status Transitions exist for an issue (as an attachment)Issue, you can iterate a section over all the attached images Status Transitions of an issue to get some metadata about themIssue. This allows you to create a table that dynamically grows according to the number of existing imagesstatus transitions. 

The notation is:

The name of the attached imageThumbnailURL image thumbnail URL.
Attachments Images Status Transitions FieldsDescription
IDThe ID of the attached image
ImageThe image of the attached image
Name
SizeThe size of the attached image
HumanReadableSizeThe size of the attached image
AuthorThe author of the attached imagestatus transition
CreatedThe date the attached image status transition was createdperformed
MimeTypeOldStatusThe type old status of the attached imagestatus transition
NewStatusThe new status of the status transition
Code Block
titleExpand to see the sample code
collapsetrue
#{for imagesstatusTransitions}
   ${ImagesStatusTransitions[n].Image|maxwidth=150|maxheight=150Author}
   ${Images[n].Name}
   ${Images[n].ID}
   ${Images[n].Size}
   ${Images[n].HumanReadableSize}
   ${Images[n].Author}
   ${dateformat("dddateformat("dd-MM-yyyy HH:mm:ss"):ImagesStatusTransitions[n].Created}
   ${ImagesStatusTransitions[n].MimeTypeOldStatus}
   ${ImagesStatusTransitions[n].ThumbnailURLNewStatus}
 ##{end}
 
or
 
#{for <VariableName>=ImagesCountStatusTransitionsCount}
   Content and ImagesStatusTransitions Mappings. Example: ${ImagesStatusTransitions[VariableName].Field}
#{end}

The image below demonstrates an example of a Word template that iterates over attached images. 

Image Removed 

or

Image Removed

Info

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.

The documents below demonstrate examples both in Word and Excel templates that iterate 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 on 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 FieldsDescription
IDThe ID of the attached image
ImageThe image of the attached image
NameThe name of the attached image
SizeThe size of the attached image
HumanReadableSizeThe size of the attached image
AuthorThe author of the attached image
CreatedThe date the attached image was created
MimeTypeThe type of the attached image
ThumbnailURLThe image thumbnail URL.
Code Block
titleExpand to see the sample code
collapsetrue
#
Code Block
titleExpand to see the sample code
collapsetrue
#{for images}
   ${Images[n].Image|widthmaxwidth=150|heightmaxheight=150}
 #{end}

These values are in pixels and if you only define one of them the image will be rescaled.

Info

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.

The image below demonstrates an example of an Excel template that iterates over attached images. 

Image Removed 

or

Image Removed

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:

...

   ${Images[n].Name}
   ${Images[n].ID}
   ${Images[n].Size}
   ${Images[n].HumanReadableSize}
   ${Images[n].Author}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Images[n].Created}
   ${Images[n].MimeType}
   ${Images[n].ThumbnailURL}
 #{end}
 
or
 
#{for <VariableName>=ImagesCount}
   Content and Images Mappings. Example: ${Images[VariableName].Field}
#{end}

The documents below demonstrate examples both in Word and Excel templates that iterate over all the Issue attached images.

Iterations_AttachedImages.docx 

Iterations_AttachedImages.xlsx

Info

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.

Code Block
titleExpand to see the sample code
collapsetrue
#{for attachmentsimages}
   ${AttachmentsImages[n].IDImage|width=150|height=150}
 #{end}

These values are in pixels and if you only define one of them the image will be rescaled.

Info

If you use the 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 FieldsDescription
IDThe ID of the attachment
NameThe name of the attachment
AuthorThe author of the attachment
AuthorFullNameThe full name of the author of the attachment
CreatedThe date the attachment was created
SizeThe size of the attachment
HumanReadableSizeThe formatted size of the attachment
MimeTypeThe type of attachment
Code Block
titleExpand to see the sample code
collapsetrue
#{for attachments   ${Attachments[n].Name}
   ${Attachments[n].Author}
   ${Attachments[n].AuthorFullName}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Attachments[n].Created}
   ${Attachments[n].Size}
   ${Attachments[n].HumanReadableSize}
   ${Attachments[n].MimeTypeID}
#{end}
 
or
 
#{for <VariableName>=AttachmentsCount   ${Attachments[n].Name}
   ${Attachments[n].Author}
   Content and Issue Mappings. Example:${Attachments[n].AuthorFullName}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Attachments[n].Created}
   ${Attachments[VariableNamen].FieldSize}
#{end}

The image below demonstrates an example of a Word template that iterates over attachments.

Image Removed

or

Image Removed

The image below demonstrates an example of an Excel template that iterates over attachments.

Image Removed

or

   ${Attachments[n].HumanReadableSize}
   ${Attachments[n].MimeType}
#{end}
 
or
 
#{for <VariableName>=AttachmentsCount}
   Content and Issue Mappings. Example: ${Attachments[VariableName].Field}
#{end}

The documents below demonstrate examples both in Word and Excel templates that iterate over all the Issue attachments.

Iterations_Attachments.docx

Image RemovedIterations_Attachments.xlsx

...

Iterating Issue Labels

Because it is not known in advance how many labels exist in an issueIssue, you can iterate a section over all the labels of an issueIssue. 

The notation is:

Attachments FieldsDescription
NameThe name of the label
Code Block
#{for labels}
   ${Labels[n].Name}
#{end}
 
or
 
#{for <VariableName>=LabelsCount}
  ${Labels[VariableName].Name}
#{end}

The image below demonstrates an example of a Word template that iterates over labels.

Image Removed

or

Image Removed

The image below demonstrates an example of an Excel template that iterates over labels.

Image Removed

or

The documents below demonstrate examples both in Word and Excel templates that iterate over all the Issue comments.

Iterations_Labels.docx

Image RemovedIterations_Labels.xlsx

...

Iterating Fix Versions of an Issue

You can iterate over all fix versions to which the issue belong that the Issue belongs to. 

The notation is:

Versions FieldsDescription
NameThe version name
DescriptionThe version description
Start dateStarting date of the version
Release dateRelease date of the version
ArchivedBoolean that indicates if the version is archived or not
ReleasedBoolean that indicates if the version is released or not
Code Block
titleExpand to see the smaple code
collapsetrue
#{for FixVersions}
	${FixVersions[n].Name}
	${FixVersions[n].Description}
	${dateformat(“dd-MM-yyyy”):FixVersions[n].Start date}
	${dateformat(“dd-MM-yyyy”):FixVersions[n].Release date}
	${FixVersions[n].Archived}
	${FixVersions[n].Released}
#{end}

or

#{for <VariableName>=FixVersionsFixVersionsCount}
   Content and Versions Issue Mappings. Example: ${FixVersions[VariableName].Field}
#{end}

The image below demonstrates an example of a Word template that iterates over fix versions that an issue belongs to.

Image Removed

or

Image Removed

The image below demonstrates an example of an Excel template that iterates over an fix versions that an issue belongs to.

Image Removed

or

Image Removed

The documents below demonstrate examples both in Word and Excel templates that iterate 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 that the Issue belongs to. 

The notation is:

Versions FieldsDescription
NameThe version name
DescriptionThe version description
Start dateStarting date of the version
Release dateRelease date of the version
ArchivedBoolean that indicates if the version is archived or not
ReleasedBoolean that indicates if the version is released or not
Code Block
titleExpand to see the sample code
collapsetrue
#{for AffectedVersions}
	${AffectedVersions[n].Name}
	${AffectedVersions[n].Description}
	${dateformat(“dd-MM-yyyy”):AffectedVersions[n].Start date}
	${dateformat(“dd-MM-yyyy”):AffectedVersions[n].Release date}
	${AffectedVersions[n].Archived}
	${AffectedVersions[n].Released}
#{end}

or

#{for <VariableName>=AffectedVersionsAffectedVersionsCount}
   Content and Versions Issue Mappings. Example: ${AffectedVersions[VariableName].Field}
#{end}

The image below demonstrates an example of a Word template that iterates over affected versions that an issue belongs to.

Image Removed

or

Image Removed

The image below demonstrates an example of an Excel template that iterates over an affected versions that an issue belongs to.

Image Removed

or

Image Removed

The documents below demonstrate examples both in Word and Excel templates that iterate 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 that the Issue belongs to.

The notation is:

Project Versions FieldsDescription
NameThe version name
DescriptionThe version description
Start dateStarting date of the version
Release dateRelease date of the version
ArchivedBoolean that indicates if the version is archived or not
ReleasedBoolean that indicates if the version is released or not
Code Block
titleExpand to see the smaple code
collapsetrue
#{for projectVersions}
	${ProjectVersions[n].Name}
	${ProjectVersions[n].Description}
	${dateformat(“dd-MM-yyyy”):ProjectVersions[n].Start date}
	${dateformat(“dd-MM-yyyy”):ProjectVersions[n].Release date}
	${ProjectVersions[n].Archived}
	${ProjectVersions[n].Released}
#{end}

or

#{for <VariableName>=ProjectVersions}
   Content and Project Versions Mappings. Example: ${ProjectVersions[VariableName].Field}
#{end}

The image below demonstrates an example of a Word template that iterates over project versions that an issue belongs to.

Image Removed

or

Image Removed

The image below demonstrates an example of an Excel template that iterates over project versions that an issue belongs to.

Image Removed

or

Image Removed

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:

...

The application type of the link

...

The URL of the link

if the version is released or not
Code Block
titleExpand to see the smaple code
collapsetrue
#{for projectVersions}
	${ProjectVersions[n].Name}
	${ProjectVersions[n].Description}
	${dateformat(“dd-MM-yyyy”):ProjectVersions[n].Start date}
	${dateformat(“dd-MM-yyyy”):ProjectVersions[n].Release date}
	${ProjectVersions[n].Archived}
	${ProjectVersions[n].Released}
#{end}

or

#{for <VariableName>=ProjectVersionsCount}
   Content and Project Versions Mappings. Example: ${ProjectVersions[VariableName].Field}
#{end}

The documents below demonstrate examples both in Word and Excel templates that iterate 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 FieldsDescription
LinkTypeThe type of the link
KeyThe key to the linked Issue
SummaryThe summary of the linked Issue
URL

The URL of the link

Code Block
titleExpand to see the sample code
collapsetrue
#{for links}
   ${Links[n].LinkType}
   ${Links[n].Key}
   ${Links[n].Summary}
   ${Links[n].URL}
#{end}
 
or
 
#{for <VariableName>=LinksCount}
   Content and Linked Issue Mappings. Example: ${Links[VariableName].Field}
#{end}

The documents below demonstrate examples both in Word and Excel templates that iterate over all the Issue links.

Iterations_Links.docx

Iterations_Links.xlsx

...

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 FieldsDescription
KeyThe key to the subtasks
SummaryThe summary of the subtasks
AssigneeUserDisplayNameThe assignee user of the subtasks
Code Block
titleExpand to see the sample code
collapsetrue
#{for subtasks}
   ${Subtasks[n].Key}
   ${Subtasks[n].Summary}
   ${Subtasks[n].AssigneeUserDisplayName}
#{end}
 
or
 
#{for <VariableName>=SubtasksCount}
   Content and Issue Mappings. Example: ${Subtasks[VariableName].Field}
#{end}

The documents below demonstrate examples both in Word and Excel templates that iterate over all the Issue subtasks.

Iterations_Subtasks.docx

Iterations_Subtasks.docx

...

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:

Code Block
titleExpand to see the sample code
collapsetrue
#{for IssuesInEpic}
   ${IssuesInEpic[n].Key}
   ${IssuesInEpic[n].Summary}
   ${IssuesInEpic[n].Description}
   ${IssuesInEpic[n].Epic Link.Key}
#{end}
 
or
 
#{for <VariableName>=IssuesInEpicCount}
   Content and Issue Mappings. Example: ${IssuesInEpic[VariableName].Field}
#{end}

The documents below demonstrate examples both in Word and Excel templates that iterate over the Issues in epic.

Iterating_Issues_In_Epic.docx

Iterating_Issues_In_Epic.xlsx

...

Iterating Project Components

You can iterate over all project components.

The notation is:

Code Block
titleExpand to see the sample code
collapsetrue
#{for ProjectComponents}
   ${ProjectComponents[n].Name}
   ${ProjectComponents[n].Description}
   ${fullname:ProjectComponents[n].Lead}
   ${ProjectComponents[n].Id}
   ${ProjectComponents[n].ProjectId}
   ${ProjectComponents[n].AssigneeType}
#{end}

#{for <VariableName>=ProjectComponentsCount}
   Content and Components Mappings. Example: ${ProjectComponents[VariableName].Field}
#{end}

The documents below demonstrate examples both in Word and Excel templates that iterate 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:

Code Block
titleExpand to see the sample code
collapsetrue
#{for <VariableName>=<LinksCount|SubtasksCount|CommentsCount|WorklogsCount>|filter=%{<Javascript>}}
   Content here
#{end}
  • 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.
Info

The filter is evaluated as a JavaScript expression, which provides flexibility in defining the conditions. You can use and (&&), or (||), and other logical operators supported by JavaScript.

It is also possible to format fields inside iteration filters.

The documents below demonstrate examples of templates that iterate over Issue links and comments with filters being applied.

Links Bugs with High Priority:

Links_with_Filter.docx

Links_with_Filter.xlsx

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 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. 

Code Block
titleExpand to see the sample code
collapsetrue
#{for links}
   ${Links[n].AppType}
   ${Links[n].LinkType}
   ${Links[n].Key}
   ${Links[n].Summary}
   ${Links[n].URL}
#{end}
 
or
 
#{for <VariableName>=LinksCount}
   Content and Linked Issue Mappings. Example: ${Links[VariableName].Field}
#{end}

All fields listed here are available on Links[n] because they represent an issue. In addition, there are two new fields at the Links[n] level: 

...

Returns the Application Type. The values can be:

Application ValueDescription

JIRA

Link from the same Jira Instance
External JiraLink from the another Jira Instance
ConfluenceLink from a Confluence page
ExternalExternal link

...

Note:  When the link you are iterating is of AppTypes External Jira or Confluence, the name is obtained using the Summary property.

The image below demonstrates an example of a Word template that iterates over linked issues.

Image Removed

or

Image Removed

The image below demonstrates an example of an Excel template that iterates over linked issues.

Image Removed

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:

...

Code Block
titleExpand to see the sample code
collapsetrue
#{for subtasks}
   ${Subtasks[n].Key}
   ${Subtasks[n].Summary}
   ${Subtasks[n].AssigneeUserDisplayName}
#{end}
 
or
 
#{for <VariableName>=SubtasksCount}
   Content and Issue Mappings. Example: ${Subtasks[VariableName].Field}
#{end}

The image below demonstrates an example of a Word template that iterates over issue subtasks.

Image Removed

or

Image Removed

The image below demonstrates an example of an Excel template that iterates over issue subtasks.

Image Removed

or

Image Removed

Iterating Preconditions

From a Precondition, it's possible to export the following Xray data: Tests.

In addition to the usual Jira mappings, you can export the following fields:

  • PreCondition.Type
  • PreCondition.Definition
  • PreConditionsCount
Code Block
titleSome mappings we can export from a Pre-condition
Key: ${Key}
Summary: ${Summary}
Type: ${PreCondition.Type}
Definition: ${PreCondition.Definition}
Count: ${PreConditionsCount}

Exporting Tests from a Precondition

Below you can find an example on how to iterate over the list of Tests associated with a Pre-condition.

Code Block
titleIterate over tests
Total number of associated tests: ${TestsCount}

// Iterating each test
#{for tests}
	Key: ${Tests[n].Key}
	Test Status: ${Tests[n].TestStatus}
	// Iterating over test steps for each test
	#{for m=Tests[n].TestStepsCount}
		Action: ${Tests[n].TestSteps[m].Action}
		Data: ${Tests[n].TestSteps[m].Data}
		Expected Result: ${Tests[n].TestSteps[m].ExpectedResult}
	#{end}
#{end}
 
or
 
// Iterating each test
#{for j=TestsCount}
	Key: ${Tests[j].Key}
	Test Status: ${Tests[j].TestStatus}
	// Iterating over test steps for each test
	#{for m=Tests[j].TestStepsCount}
		Action: ${Tests[j].TestSteps[m].Action}
		Data: ${Tests[j].TestSteps[m].Data}
		Expected Result: ${Tests[j].TestSteps[m].ExpectedResult}
	#{end}
#{end}

For more detailed information on how to export Tests and its information please check the Test section.

Iterating Tests

From a Test, it's possible to export the following Xray data: Preconditions, Test Sets, TestPlans, Test Executions, and Test Runs.

In addition to the usual Jira mappings, you can export the following fields:

  • Cucumber Scenario
  • Generic Test Definition
  • TestType
  • TestStatus
  • TestStepsCount
  • TestsCount
Code Block
titleSome mappings we can export from a Test
Key: ${Key}
Cucumber Scenario: ${Cucumber Scenario}
Generic Test Definition: ${Generic Test Definition}
Test Type: ${TestType}
Test Status: ${TestStatus}
Test Steps Total: ${TestStepsCount}
Tests Count: ${TestsCount}

Exporting Test Steps from a Test

For each Test Step you can export the following fields:

  • Action
  • AttachmentsCount
  • Data
  • ExpectedResult
  • StepNumber

Below you can find an example on how to iterate over the list of TestSteps associated with a Test.

Code Block
titleIterate over test steps
Total number of associated test steps: ${TestStepsCount}

// Iterating each test step
#{for teststeps}
	 Action: ${TestSteps[n].Action}
     Data: ${TestSteps[n].Data}
     Expected Result: ${TestSteps[n].ExpectedResult}
     Step Number: ${TestSteps[n].StepNumber}
     // Iterating over attachments for each test step
     #{for l=TestSteps[n].AttachmentsCount}
     	Id: ${TestSteps[n].Attachments[l].Id}
        Name: ${TestSteps[n].Attachments[l].Name}
        Image: ${TestSteps[n].Attachments[l].Image}
        FileURL: ${TestSteps[n].Attachments[l].FileURL}
     #{end}
#{end}
 
or
 
// Iterating each test step
#{for j=TestStepsCount}
	 Action: ${TestSteps[j].Action}
     Data: ${TestSteps[j].Data}
     Expected Result: ${TestSteps[j].ExpectedResult}
     Step Number: ${TestSteps[j].StepNumber}
     // Iterating over attachments for each test step
     #{for l=TestSteps[j].AttachmentsCount}
     	Id: ${TestSteps[j].Attachments[l].Id}
        Name: ${TestSteps[j].Attachments[l].Name}
		Image: ${TestSteps[n].Attachments[l].Image}
        FileURL: ${TestSteps[n].Attachments[l].FileURL}
     #{end}
#{end}

Exporting Preconditions from a Test

Below you can find an example on how to iterate over the list of Preconditions associated with a Test.

Code Block
titleIterate over preconditions
Total number of associated preconditions: ${PreConditionsCount}

// Iterating each precondition
#{for preconditions}
	Key: ${PreConditions[n].Key}
	Type: ${PreConditions[n].PreCondition.Type}
	Definition: ${PreConditions[n].PreCondition.Definition}
#{end}
 
or
 
// Iterating each precondition
#{for j=PreConditionsCount}
	Summary: ${PreConditions[j].Summary}
	Type: ${PreConditions[j].PreCondition.Type}
	Definition: ${PreConditions[j].PreCondition.Definition}
#{end}

For more detailed information on how to export Pre-conditions and its information please check the Precondition section.

Exporting Test Sets from a Test

Below you can find an example on how to iterate over the list of TestSets associated with a Test.

Code Block
titleIterate over test sets
Total number of associated test sets: ${TestSetsCount}

// Iterating each test set
#{for testSets}
	Description: ${TestSets[n].Description}
#{end}
 
or
 
// Iterating each test set
#{for j=TestSetsCount}
	Summary: ${TestSets[j].Summary}
#{end}

For more detailed information on how to export Test Sets and its information please check the Test Set section.

Exporting Test Plans from a Test

Below you can find an example on how to iterate over the list of TestPlans associated with a Test.

Code Block
titleIterate over test plans
Total number of associated test plans: ${TestPlansCount}

// Iterating each test plan
#{for testPlans}
	Summary: ${TestPlans[n].Summary}
#{end}
 
or
 
// Iterating each test plan
#{for j=TestPlansCount}
	Description: ${TestPlans[j].Description}
#{end}

For more detailed information on how to export Test Plans and its information please check the Test Plan section.

Exporting Test Executions from a Test

Below you can find an example on how to iterate over the list of TestExecutions associated with a Test.

Code Block
titleIterate over test executions
Total number of associated test executions: ${TestExecutionsCount}

// Iterating each test execution
#{for testExecutions}
	Key: ${TestExecutions[n].Key}
	Test Environments: ${TestExecutions[n].TestEnvironments}
#{end}
 
or
 
// Iterating each test execution
#{for j=TestExecutionsCount}
	Summary: ${TestExecutions[j].Summary}
	Test Environments: ${TestExecutions[j].TestEnvironments}
#{end}

For more detailed information on how to export Test Executions and its information please check the Test Execution section.

Exporting Test Runs from a Test

Below you can find an example on how to iterate over the list of TestRuns associated with a Test.

Code Block
titleIterate over test runs
Total number of associated test runs: ${TestRunsCount}

// Iterating each test run
#{for testruns}
    Assignee Id: ${TestRuns[n].AssigneeId}
    Key: ${TestRuns[n].Key}
    Summary: ${TestRuns[n].Summary}
    Comment: ${TestRuns[n].Comment}
    Generic Test Definition: ${TestRuns[n].Generic Test Definition}
    Cucumber Scenario: ${TestRuns[n].Cucumber Scenario}
    Executed by: ${TestRuns[n].Executed By}
    Execution Status: ${TestRuns[n].Execution Status}
    Started on: ${TestRuns[n].Started On}
    Finished on: ${TestRuns[n].Finished On}

    // Iterating over execution evidences for each test run
    Execution Evidences Total: ${TestRuns[n].ExecutionEvidencesCount}
    #{for m=TestRuns[n].ExecutionEvidencesCount}
        Id: ${TestRuns[n].ExecutionEvidences[m].Id}
        Name: ${TestRuns[n].ExecutionEvidences[m].Name}
    #{end}

    // Iterating over execution defects for each test run
    Execution Defects Total: ${TestRuns[n].ExecutionDefectsCount}
    #{for m=TestRuns[n].ExecutionDefectsCount}
        Id: ${TestRuns[n].ExecutionDefects[m].Id}
        Description: ${TestRuns[n].ExecutionDefects[m].Description}
        Key: ${TestRuns[n].ExecutionDefects[m].Key}
        Summary: ${TestRuns[n].ExecutionDefects[m].Summary}
    #{end}

    // Iterating over test steps for each test run
    Test Steps Total: ${TestRuns[n].TestStepsCount}
    #{for m=TestRuns[n].TestStepsCount}
        Action: ${TestRuns[n].TestSteps[m].Action}
        Comment: ${TestRuns[n].TestSteps[m].Comment}
        Data: ${TestRuns[n].TestSteps[m].Data}
        Expected Result: ${TestRuns[n].TestSteps[m].ExpectedResult}
		Actual Result: ${TestRuns[n].TestSteps[m].ActualResult}
        Status: ${TestRuns[n].TestSteps[m].Status}
        Step Number: ${TestRuns[n].TestSteps[m].StepNumber}
        // Iterating over attachments for each test step
        #{for l=TestRuns[n].TestSteps[m].AttachmentsCount}
            Id: ${TestRuns[n].TestSteps[m].Attachments[l].Id}
            Name: ${TestRuns[n].TestSteps[m].Attachments[l].Name}
            Image: ${TestRuns[n].TestSteps[m].Attachments[l].Image}
            FileURL: ${TestRuns[n].TestSteps[m].Attachments[l].FileURL}
        #{end}
        // Iterating over evidences for each test step
        #{for l=TestRuns[n].TestSteps[m].EvidencesCount}
            Id: ${TestRuns[n].TestSteps[m].Evidences[l].Id}
            Name: ${TestRuns[n].TestSteps[m].Evidences[l].Name}
        #{end}
        // Iterating over defects for each test step
        #{for l=TestRuns[n].TestSteps[m].DefectsCount}
            Description: ${TestRuns[n].TestSteps[m].Defects[l].Description}
            Id: ${TestRuns[n].TestSteps[m].Defects[l].Id}
            Key: ${TestRuns[n].TestSteps[m].Defects[l].Key}
            Summary: ${TestRuns[n].TestSteps[m].Defects[l].Summary}
        #{end}
    #{end}
#{end}

Iterating Test Executions

From a Test Execution, it's possible to export the following Xray data: Tests and Test Runs.

In addition to the usual Jira mappings, you can export the following fields:

  • TestEnvironments
Code Block
titleSome mappings we can export from a Test Execution
Key: ${Key}
Description: ${Description}
Test Environments: ${TestEnvironments}

#Overall Execution Status (percentage + total of testes per status)
TO DO: ${Overall Execution Status.TO DO.Percentage}% - ${Overall Execution Status.TO DO.Count}
EXECUTING: ${Overall Execution Status.EXECUTING.Percentage}% - ${Overall Execution Status.EXECUTING.Count}
PASSED: ${Overall Execution Status.PASSED.Percentage}% - ${Overall Execution Status.PASSED.Count}
FAILED: ${Overall Execution Status.FAILED.Percentage}% - ${Overall Execution Status.FAILED.Count}
ABORTED: ${Overall Execution Status.ABORTED.Percentage}% - ${Overall Execution Status.ABORTED.Count}

Exporting Tests from a Test Execution

Below you can find an example on how to iterate over the list of Tests associated with a Test Execution.

Code Block
titleIterate over tests
Total number of associated tests: ${TestsCount}

// Iterating each test
#{for tests}
	Key: ${Tests[n].Key}
	Test Status: ${Tests[n].TestStatus}
	// Iterating over test steps for each test
	#{for m=Tests[n].TestStepsCount}
		Action: ${Tests[n].TestSteps[m].Action}
		Data: ${Tests[n].TestSteps[m].Data}
		Expected Result: ${Tests[n].TestSteps[m].ExpectedResult}
	#{end}
#{end}
 
or
 
// Iterating each test
#{for j=TestsCount}
	Key: ${Tests[j].Key}
	Test Status: ${Tests[j].TestStatus}
	// Iterating over test steps for each test
	#{for m=Tests[j].TestStepsCount}
		Action: ${Tests[j].TestSteps[m].Action}
		Data: ${Tests[j].TestSteps[m].Data}
		Expected Result: ${Tests[j].TestSteps[m].ExpectedResult}
	#{end}
#{end}

For more detailed information on how to export Tests and its information please check the Test section.

Exporting Test Plans from a Test Execution

Below you can find an example on how to iterate over the list of TestPlans associated with a Test Execution.

Code Block
titleIterate over test plans
Total number of associated test plans: ${TestPlansCount}

// Iterating each test plan
#{for testPlans}
	Summary: ${TestPlans[n].Summary}
#{end}
 
or
 
// Iterating each test plan
#{for j=TestPlansCount}
	Description: ${TestPlans[j].Description}
#{end}

For more detailed information on how to export Test Plans and its information please check the Test Plan page.

Exporting Test Runs from a Test Execution

Below you can find an example on how to iterate over the list of TestRuns associated with a Test Execution.

Code Block
titleIterate over test runs
Total number of associated test runs: ${TestRunsCount}

// Iterating each test run
#{for testruns}
    Assignee Id: ${TestRuns[n].AssigneeId}
    Key: ${TestRuns[n].Key}
    Summary: ${TestRuns[n].Summary}
    Comment: ${TestRuns[n].Comment}
    Generic Test Definition: ${TestRuns[n].Generic Test Definition}
    Cucumber Scenario: ${TestRuns[n].Cucumber Scenario}
    Executed by: ${fullname:TestRuns[n].Executed By}
    Execution Status: ${TestRuns[n].Execution Status}
    Started on: ${TestRuns[n].Started On}
    Finished on: ${TestRuns[n].Finished On}

    // Iterating over execution evidences for each test run
    Execution Evidences Total: ${TestRuns[n].ExecutionEvidencesCount}
    #{for m=TestRuns[n].ExecutionEvidencesCount}
        Id: ${TestRuns[n].ExecutionEvidences[m].Id}
        Name: ${TestRuns[n].ExecutionEvidences[m].Name}
        Size: ${TestRuns[n].ExecutionEvidences[m].Size}
        HumanReadableSize: ${TestRuns[n].ExecutionEvidences[m].HumanReadableSize}
        Created: ${TestRuns[n].ExecutionEvidences[m].Created}
        MimeType: ${TestRuns[n].ExecutionEvidences[m].MimeType}
        Evidence: ${TestRuns[n].ExecutionEvidences[m].Evidence}
        FileURL: ${TestRuns[n].ExecutionEvidences[m].FileURL}
    #{end}

    // Iterating over execution defects for each test run
    Execution Defects Total: ${TestRuns[n].ExecutionDefectsCount}
    #{for m=TestRuns[n].ExecutionDefectsCount}
        Id: ${TestRuns[n].ExecutionDefects[m].Id}
        Description: ${TestRuns[n].ExecutionDefects[m].Description}
        Key: ${TestRuns[n].ExecutionDefects[m].Key}
        Summary: ${TestRuns[n].ExecutionDefects[m].Summary}
    #{end}

    // Iterating over test steps for each test run
    Test Steps Total: ${TestRuns[n].TestStepsCount}
    #{for m=TestRuns[n].TestStepsCount}
        Action: ${TestRuns[n].TestSteps[m].Action}
        Comment: ${TestRuns[n].TestSteps[m].Comment}
        Data: ${TestRuns[n].TestSteps[m].Data}
        Expected Result: ${TestRuns[n].TestSteps[m].ExpectedResult}
		Actual Result: ${TestRuns[n].TestSteps[m].ActualResult}
        Status: ${TestRuns[n].TestSteps[m].Status}
        Step Number: ${TestRuns[n].TestSteps[m].StepNumber}
        // Iterating over attachments for each test step
        #{for l=TestRuns[n].TestSteps[m].AttachmentsCount}
            Id: ${TestRuns[n].TestSteps[m].Attachments[l].Id}
            Name: ${TestRuns[n].TestSteps[m].Attachments[l].Name}
            Image: ${TestRuns[n].TestSteps[m].Attachments[l].Image}
            FileURL: ${TestRuns[n].TestSteps[m].Attachments[l].FileURL}
        #{end}
        // Iterating over evidences for each test step
        #{for l=TestRuns[n].TestSteps[m].EvidencesCount}
            Id: ${TestRuns[n].TestSteps[m].Evidences[l].Id}
            Name: ${TestRuns[n].TestSteps[m].Evidences[l].Name}
			Size: ${TestRuns[n].TestSteps[m].Evidences[l].Size}
			HumanReadableSize: ${TestRuns[n].TestSteps[m].Evidences[l].HumanReadableSize}
			Created: ${TestRuns[n].TestSteps[m].Evidences[l].Created}
			MimeType: ${TestRuns[n].TestSteps[m].Evidences[l].MimeType}
			Evidence: ${TestRuns[n].TestSteps[m].Evidences[l].Evidence}
			FileURL: ${TestRuns[n].TestSteps[m].Evidences[l].FileURL}
        #{end}
        // Iterating over defects for each test step
        #{for l=TestRuns[n].TestSteps[m].DefectsCount}
            Description: ${TestRuns[n].TestSteps[m].Defects[l].Description}
            Id: ${TestRuns[n].TestSteps[m].Defects[l].Id}
            Key: ${TestRuns[n].TestSteps[m].Defects[l].Key}
            Summary: ${TestRuns[n].TestSteps[m].Defects[l].Summary}
        #{end}
    #{end}
#{end}

Iterating Test Plans

From a Test Plan, it's possible to export the following Xray data: Tests and Test Executions.

Given that the Test Plan behaves like a regular JIRA issue, you can also export any other JIRA field.

Code Block
titleSome general mappings we can export from a Test Plan
Key: ${Key}
Description: ${Description}

#Overall Execution Status (percentage + total of testes per status)
TO DO: ${Overall Execution Status.TO DO.Percentage}% - ${Overall Execution Status.TO DO.Count}
EXECUTING: ${Overall Execution Status.EXECUTING.Percentage}% - ${Overall Execution Status.EXECUTING.Count}
PASSED: ${Overall Execution Status.PASSED.Percentage}% - ${Overall Execution Status.PASSED.Count}
FAILED: ${Overall Execution Status.FAILED.Percentage}% - ${Overall Execution Status.FAILED.Count}
ABORTED: ${Overall Execution Status.ABORTED.Percentage}% - ${Overall Execution Status.ABORTED.Count}

Exporting Tests from a Test Plan

Below you can find an example on how to iterate over the list of Tests associated with a Test Plan.

Code Block
titleIterate over tests
Total number of associated tests: ${TestsCount}

// Iterating each test
#{for tests}
	Key: ${Tests[n].Key}
	Test Status: ${Tests[n].TestStatus}
	// Iterating over test steps for each test
	#{for m=Tests[n].TestStepsCount}
		Action: ${Tests[n].TestSteps[m].Action}
		Data: ${Tests[n].TestSteps[m].Data}
		Expected Result: ${Tests[n].TestSteps[m].ExpectedResult}
	#{end}
#{end}
 
or
 
// Iterating each test
#{for j=TestsCount}
	Key: ${Tests[j].Key}
	Test Status: ${Tests[j].TestStatus}
	// Iterating over test steps for each test
	#{for m=Tests[j].TestStepsCount}
		Action: ${Tests[j].TestSteps[m].Action}
		Data: ${Tests[j].TestSteps[m].Data}
		Expected Result: ${Tests[j].TestSteps[m].ExpectedResult}
	#{end}
#{end}

For more detailed information on how to export Tests and its information please check the Test section.

Exporting Test Executions from a Test Plan

Below you can find an example on how to iterate over the list of TestExecutions associated with a Test.

Code Block
titleIterate over test executions
Total number of associated test executions: ${TestExecutionsCount}

// Iterating each test execution
#{for testExecutions}
	Key: ${TestExecutions[n].Key}
	Test Environments: ${TestExecutions[n].TestEnvironments}
#{end}
 
or
 
// Iterating each test execution
#{for j=TestExecutionsCount}
	Summary: ${TestExecutions[j].Summary}
	Test Environments: ${TestExecutions[j].TestEnvironments}
#{end}

// Print the Test Execution issue keys
${TestExecutionKeys}

For more detailed information on how to export Test Executions and its information please check the Test Execution section.

Iterating Test Sets

From a Test Set, it's possible to export the following Xray data: Tests.

Given that the Test Set behaves like a regular Jira issue, you can also export any other Jira field.

Code Block
titleSome general mappings we can export from a Test Set
Key: ${Key}
Description: ${Description}

#Overall Execution Status (percentage + total of testes per status)
TO DO: ${Overall Execution Status.TO DO.Percentage}% - ${Overall Execution Status.TO DO.Count}
EXECUTING: ${Overall Execution Status.EXECUTING.Percentage}% - ${Overall Execution Status.EXECUTING.Count}
PASSED: ${Overall Execution Status.PASSED.Percentage}% - ${Overall Execution Status.PASSED.Count}
FAILED: ${Overall Execution Status.FAILED.Percentage}% - ${Overall Execution Status.FAILED.Count}
ABORTED: ${Overall Execution Status.ABORTED.Percentage}% - ${Overall Execution Status.ABORTED.Count}

Exporting Tests from a Test Set

Below you can find an example on how to iterate over the list of Tests associated with a Test Set.

Code Block
titleIterate over Tests
Total number of associated tests: ${TestsCount}

// Iterating each test
#{for tests}
	Key: ${Tests[n].Key}
	Test Status: ${Tests[n].TestStatus}
	// Iterating over test steps for each test
	#{for m=Tests[n].TestStepsCount}
		Action: ${Tests[n].TestSteps[m].Action}
		Data: ${Tests[n].TestSteps[m].Data}
        Expected Result: ${Tests[n].TestSteps[m].ExpectedResult}
	#{end}
#{end}
 
or
 
// Iterating each test
#{for j=TestsCount}
	Key: ${Tests[j].Key}
	Test Status: ${Tests[j].TestStatus}
	// Iterating over test steps for each test
	#{for m=Tests[j].TestStepsCount}
		Action: ${Tests[j].TestSteps[m].Action}
		Data: ${Tests[j].TestSteps[m].Data}
		Expected Result: ${Tests[j].TestSteps[m].ExpectedResult}
	#{end}
#{end}

For more detailed information on how to export Tests and its information please check the Test page.

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:

Code Block
titleExpand to see the sample code
collapsetrue
#{for <VariableName>=<LinksCount|SubtasksCount|CommentsCount|WorklogsCount>|filter=%{<Javascript>}}
   Content here
#{end}
  • 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 image below demonstrates an example of a template that iterates over issue links and comments with filters being applied.

Links Bugs with High Priority:

Image Removed

Nested Iterations:

Image Removed

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. 

Code Block
titleExpand to see the sample code
collapsetrue
Users that added comments to this issue: #{for comments}${Comments[n].Author} #{end}

Subtasks of this issue: #{for j=SubtasksCount}${Subtasks[j].Key};#{end}

Linked issues this issue duplicates: #{for j=LinksCount|filter=%{'${Links[j].LinkType}'.equals('duplicates')}}${Links[j].Key} #{end}

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.

Code Block
titleExpand to see the sample code
collapsetrue
Issue iteration as a demonstration.
Copy this iteration below and paste it into a cell.
 
&{for issues} ${Key} &{end}

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. 

Users that added comments to this issue: #{for comments}${Comments[n].Author} #{end}

Subtasks of this issue: #{for j=SubtasksCount}${Subtasks[j].Key};#{end}

Linked issues this issue duplicates: #{for j=LinksCount|filter=%{'${Links[j].LinkType}'.equals('duplicates')}}${Links[j].Key} #{end}

...

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.

Code Block
titleExpand to see the sample code
collapsetrue
Issue iteration as a demonstration.
Copy this iteration below and paste it into a cell.
 
&{for issues} ${Key} &{end}

...

Iterating with the BREAK or CONTINUE Statements

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. 

Code Block
titleExpand to see the sample code
collapsetrue
Imagine that you have a Jira Issue that contains these comments:
- Hello
- World
- Greetings
- Hi
 
For the Break functionality, lets say that you want to stop the iteration if the current comment is "World". Here is the template for that:
#{for comments}
Current Comment: ${Comments[n].Body}
#{if (%{'${Comments[n].Body}'.equals('World')})}
#{break}
#{end}
Current Comment Author: ${Comments[n].Author}
#{end}

Code Block
titleExpand to see the sample code
collapsetrue
Imagine that you have a Jira Issue that contains these comments:
- Hello
- World
- Greetings
- Hi
 
For the Break functionality, lets say that you want to stop the iteration if the current comment is "World". Here is the template for that:
#{for comments}
Current Comment: ${Comments[n].Body}
#{if (%{'${Comments[n].Body}'.equals('World')})}
#{break}
#{end}
Current Comment Author: ${Comments[n].Author}
#{end}
In this case, Xporter for Jira will print the comment "Hello" and it´s author. Next it will print the comment Body "World" but since the Conditional expression is true, it will stop the iteration all together and not print anything else.
Note: Anything after the #{break} mapping will not be printed in the exported document.
 
For the Continue functionality, lets say that you want to skip to the next iteration if the current comment is "World", bypassing the Author mapping for this iteration. Here is the template for that:
#{for comments}
Current Comment: ${Comments[n].Body}
#{if (%{'${Comments[n].Body}'.equals('World')})}
#{continue}
#{end}
Current Comment Author: ${Comments[n].Author}
#{end}
In this case, Xporter for Jira will print the comment "Hello" and it´s author. Next, it will print the comment Body "World" but since the Conditional expression is true, it will continue to the next iteration, not printing the Author of the "World" comment.

...

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>}
Info

...

The mapping after the

...

sortby

...

must be equal to the supported mappings for each Iteration.

Example:

Code Block
titleExpand to see the sample code
collapsetrue
This iteration will be sorted by the Body of all the comments in the issue.

#{for comments|sortby=Body}
${Comments[n].Author}
${Comments[n].Body}
#{end}

Sort By Bulk

...

Export

The sortby can also be used to sort a &{for issues} iteration on a Bulk Export.

...

Info
titleSorting Criteria

asc asc and desc  desc can be defined in order to define how do you want to sort your data. The default value is ascis asc

Expand
titleSupport/Troubleshooting

If you have questions or technical issues, please contact the Support team via the Customer Portal (Jira service management) or send us a message using the in-app chat.