Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Iterating

...

Issue Activity 
Status
colourYellow
titleDeprecaTED

Changes to issues are registered in the Issue Activity, but it is not known in advance how many changes are going to be made. You can iterate a section over all the activities of an issue. This allows you to create a table that dynamically grows according to the number of existing activities. The notation is:

...

Code Block
titleExpand to see the sample code
collapsetrue
#{for activityEntries}
   ${ActivityEntries[n].Title}
   ${ActivityEntries[n].Summary}
   ${ActivityEntries[n].Content}
   ${ActivityEntries[n].Author}
   ${ActivityEntries[n].AuthorEmail}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):ActivityEntries[n].Published}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):ActivityEntries[n].Updated}
   ${ActivityEntries[n].Categories}
#{end}
 
or
 
#{for <VariableName>=ActivityEntriesCount}
   Content and Issue Mappings. Example: ${ActivityEntries[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 Links

Because it is not known The documents below demonstrate examples both in Word and Excel template that iterates over linked issues.

Image AddedIterating_Issue_Activity.docx

Image AddedIterating_Issue_Activity.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:

...

.

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: 

The URL of the link
Field

Description

AppType

The application type of the link

LinkTypeThe type of the link
KeyThe key of the linked issue
SummaryThe summary of the linked issue
URL

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
LinkTypeReturns the Link Type.
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

For a working example of this functionality, check the SampleIterations.docx template on the  Samples Page.

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

Image Removed

or

Image Removed

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:

...

The author of the comment

...

titleExpand to see the sample code
collapsetrue

...

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

The documents below demonstrate examples both in Word and Excel template that iterates over linked issues.

Image Added Iterating_Issue_Links.docx

Image Added Iterating_Issue_Links.xlsx

...

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 FieldsDescription
Author

The author of the comment

AuthorFullNameThe full name of the author of the comment
Body

The comment body 

Status
colourBlue
titleWiki

CreatedThe date the comment was posted
CreatedDateThe date the comment was posted
CreatedDateTimeThe date the comment was posted
GroupLevelThe group level of the comment
InternalThe comment is internal or public
Code Block
titleExpand to see the sample code
collapsetrue
#{for comments}
   ${Comments[n].Author} 
   ${Comments[n].AuthorFullName} 
   ${Comments[n].Body} 
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Comments[n].Created}
   ${Commentsdateformat("dd-MM-yyyy HH:mm:ss"):Comments[n].CreatedDate}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Comments[n].CreatedDateTime}
   ${Comments[n].GroupLevel}
   ${Comments[n].Internal}
#{end}
 
or
 
#{for <VariableName>=CommentsCount}
   Content and Issue Mappings. Example: ${Comments[VariableName].Field}
#{end}

The image below demonstrates an example of a Word The documents below demonstrate examples both in Word and Excel template that iterates over all the issue comments.

Image Removed

or

Image Removed

For a working example of this functionality, check the SampleIterations.docx template in the Samples Page.

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

Image Removed

or

Image Removed

Info
titleJira Service Desk
If you are using Jira Service Desk you can see more information about comments here.

Image Added Iterating_Issue_Comments.docx

Image Added Iterating_Issue_Comments.xlsx

...

Iterating Issue Worklogs

Because it is not known in advance how many worklogs exist for an issue, you can iterate a section over all the worklogs of an issue. This allow 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

Status
colourBlue
titleWiki

Created

The worklog's creation date.

CreatedDate

The worklog's creation date.

CreatedDateTime

The worklog's creation date.

Date Started

The date the worklog was started

StartDate

The date the worklog was

created

started

Date Started
StartDateTime

The date the worklog was started

TimeSpentThe time spent in seconds

Time Spent

The time spent in seconds

TimeSpentFormatted

The time spent as displayed on Jira
BilledHours
BillableSecondsThe
billed hours in seconds (Belongs to Tempo Timesheets plugin)BilledHoursFormattedThe billed hours as displayed on Jira
billable seconds (Belongs to Tempo Timesheets plugin)
Code Block
titleExpand to see the sample code
collapsetrue
#{for worklogs}
   ${Worklogs[n].Author} 
   ${Worklogs[n].AuthorFullName} 
   ${Worklogs[n].Comment}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Worklogs[n].Created}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Worklogs[n].Date Started} 
CreatedDate}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Worklogs[n].Time SpentCreatedDateTime}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Worklogs[n].TimeSpentFormattedStartDate} 
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Worklogs[n].BilledHoursDate Started} 
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Worklogs[n].BilledHoursFormattedStartDateTime} 
#   ${Worklogs[n].Time Spent}
   ${Worklogs[n].TimeSpent}
   ${Worklogs[n].TimeSpentFormatted} 
   ${Worklogs[n].BillableSeconds}
#{end}
 
or
 
#{for <VariableName>=WorklogsCount}
   Content and Worklog Mappings. Example: ${Worklogs[VariableName].Field}
#{end}

The  image below demonstrates an example of a Word documents below demonstrate examples both in Word and Excel template that iterates over the issue worklogs.

Image Removed

or

Image Removed

For a working example of this functionality, check the SampleIterations.docx template on the Samples Page.

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

Image Removed

...

or

...

Iterating Issue Subtasks

Image Added Iterating_Issue_Worklogs.docx

Image Added Iterating_Issue_Worklogs.xlsx

...

Iterating Issue Subtasks

All fields listed here are available on Subtasks[n] because they represent an issue.

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

The

...

documents below demonstrate examples both in Word and Excel template that iterates over the issue subtasks.

Image Removed

or

Image Removed

For a working example of this functionality, check the SampleIterations.docx template on the Samples Page.

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

Image Removed

or

Image Removed

For an example of how to iterate the details of a subtask Parent issue, please check the Iterating JQL Queries area below.

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 Image Added Iterating_Issue_Subtasks.docx

Image Added Iterating_Issue_Subtasks.xlsx

...

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:

...

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

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

Image Removed

...

}

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

The documents below demonstrate examples both in Word and Excel template that iterates over the issue components.

Image Added Iterating_Issue_Components. Image Removeddocx

Image Added Iterating_Issue_Components.xlsx

...

Iterating Issue Status Transitions

...

old status of NewStatus new status of
Status Transitions FieldsDescription
AuthorThe author of the status transition
CreatedThe date the status transition was performedOldStatus
CreatedDateThe date the status transition was performed
CreatedDateTimeThe date the status transition was performed

...

OldStatusThe old status of the status transition
NewStatusThe new status of the status transition
Code Block
titleExpand to see the sample code
collapsetrue
#{for statusTransitions}
   ${StatusTransitions[n].Author}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):StatusTransitions[n].Created}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):StatusTransitions[n].CreatedDate}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):StatusTransitions[n].CreatedDateTime}
   ${StatusTransitions[n].OldStatus}
   ${StatusTransitions[n].NewStatus}
#{end}
 
or
 
#{for <VariableName>=StatusTransitionsCount}
   Content and StatusTransitions Mappings. Example: ${StatusTransitions[VariableName].Field}
#{end}

...

The documents below demonstrate examples both in Word and Excel template that iterates over the issue 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

Image Added Iterating_Issue_StatusTransitions.docx

Image Added Iterating_Issue_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 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 (ID) of the attached image
CreatedThe date the attached image was created
CreatedDateThe date the attached image was created
CreatedDateTimeThe date the attached image was created
MimeTypeThe type of the attached image
ThumbnailURLThe URL to the thumbnail of the image
Code Block
titleExpand to see the sample code
collapsetrue
#{for images}
   ${Images[n].Image|maxwidth=150|maxheight=150}
   ${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}dateformat("dd-MM-yyyy HH:mm:ss"):Images[n].CreatedDate}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Images[n].CreatedDateTime}
   ${Images[n].MimeType}
   ${Images[n].ThumbnailURL}
 #{end}
 
or
 
#{for <VariableName>=ImagesCount}
   Content and Images Mappings. Example: ${Images[VariableName].Field}
#{end}

The image below demonstrates an example of a Word The documents below demonstrate examples both in Word and Excel template that iterates over the attached images for each issue. 

Image Removed 

or

Image Removed

Image Added Iterating_Issue_Images.docx

Image Added Iterating_Issue_Images.xlsx


Info

Xporter will automatically read the EXIF orientation property of an image and rotate it to its correct orientation. You can turn this off by adding this property to your template.

Since Xporter 5.5.0, you You can use the mappings width and height to define the exact width and height of the printed image.

...

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

Info

You can iterate over ${Images[n].Image} in Excel on Xporter version 5.4.0 and above.

...

Iterating Issue Attachments

...

Attachments FieldsDescription
IDThe ID of the attachment
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 createdSize
CreatedDateThe date the attachment was created
CreatedDateTimeThe date the attachment was created
SizeThe size of the attachment
HumanReadableSizeThe formatted size of the attachment
MimeTypeThe type of the attachment
Code Block
titleExpand to see the sample code
collapsetrue
#{for attachments}
   ${Attachments[n].ID}
   ${Attachments[n].Name}
   ${Attachments[n].Author}
   ${Attachments[n].AuthorFullName}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Attachments[n].Created}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Attachments[n].CreatedDate}
   ${dateformat("dd-MM-yyyy HH:mm:ss"):Attachments[n].CreatedDateTime}
   ${Attachments[n].Size}
   ${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 template that iterates over the issue's attachments.

Image Removed

or

Image Removed

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

...

or

Image RemovedImage Added Iterating_Issue_Attachments.docx

Image Added Iterating_Issue_Attachments.xlsx

...

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 FieldsDescription
NameThe name of the label
Code Block
titleExpand to see the sample code
collapsetrue
#{for labels}
   ${Labels[n].Name}
#{end}
 
or
 
#{for <VariableName>=LabelsCount}
   Content and Versions Issue Mappings. Example: ${Labels[VariableName].NameField}
#{end}

The image below demonstrates an example of a Word The documents below demonstrate examples both in Word and Excel template that iterates over the issue's labels.

Image Removed

or

Image Removed

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

Image Removed

or

Image Removed

...

Image Added Iterating_Issue_Labels.docx

Image Added Iterating_Issue_Labels.xlsx

...

Iterating Fix Versions of an Issue

You can iterate over all project fix versions to which the issue belong to. The notation is:

The Date project
Attachments Versions FieldsDescription
NameThe version name of the project version
DescriptionThe version description of the project version
Start dateThe Start Date Starting date of the project 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 FixVersions}
	${FixVersions[n].Name}
   	${ProjectVersionsFixVersions[n].Description}
   	${dateformat("dd“dd-MM-yyyy"yyyy”):ProjectVersionsFixVersions[n].Start date}
   	${dateformat("dd“dd-MM-yyyy"yyyy”):ProjectVersionsFixVersions[n].Release date}
#{end}
 	${FixVersions[n].Archived}
	${FixVersions[n].Released}
#{end}

or


#{for <VariableName>=ProjectVersionsCountFixVersionsCount}
   ${ProjectVersions[VariableName].Name}
   ${ProjectVersions[VariableName].Description}
   ${dateformat("dd-MM-yyyy"):ProjectVersions[VariableName].Start date}
   ${dateformat("dd-MM-yyyy"):ProjectVersions[VariableName].Release dateContent and Versions Issue Mappings. Example: ${FixVersions[VariableName].Field}
#{end}

The image below demonstrates an example of a Word The documents below demonstrate examples both in Word and Excel template that iterates over project version.

Image Removed

or

Image Removed

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

Image Removed

or

Image Removed

Iterating JQL Queries

You can iterate issues that are the result of a JQL Query. The syntax is similar to the other iterations, but there is a clause parameter that will receive the JQL Query. A few examples are provided below.the issue's fix versions.

Image Added Iterating_Issue_FixVersions.docx

Image Added Iterating_Issue_FixVersions.xlsx

...

Iterating Affected Versions of an Issue

You can iterate over all affected versions to which 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
a simple example iterating the details of issues from a specified Project:
 
#{for i=JQLIssuesCount|clause=project = DEMO}
   ${JQLIssues[i].Key}
   ${JQLIssues[i].Summary} 
#{end}

or a more advanced example iterating the details of issues linked with the current Issue:
 
#{for m=JQLIssuesCount|clause=issuekey in linkedIssues (${Links[j].Key})}
   Linked Issue ${JQLIssues[m].Summary} has ${JQLIssues[m].LinksCount} links
#{end} 
 
or an also advanced example iterating the details of the Parent issue from the current Subtask:
 
#{for i=JQLIssuesCount|clause=issuekey = ${ParentIssueKey}}
	${JQLIssues[i].Key}
	${JQLIssues[i].Id}
	${JQLIssues[i].Description}
#{end}

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

Image Removed

For a working example of this functionality, check the template Sample Iterations in the Template Store.

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

Image Removed
 

Info

You can also use a Filter Name or a Filter Id as a clause. For more info, check [http://confluence.xpand-addons.com/display/public/XPORTER/JQL]

Iterating Issue Commits

Because it is not known in advance how many commits exist for an issue, you can iterate a section over all the commits of an issue. This allows you to create a table that dynamically grows according to the number of existing commits. The notation is:

...

The URL of the link

...

Message

...

Author

...

 Image Removed

Code Block
titleExpand to see the sample code
collapsetrue
#{for commits}
	${Commits[n].Author} 
	${Commits[n].URL} 
	${Commits[n].Message}
	${Commits[n].CreatedDateTime}
	
	Here we have the FilesCount where we can get all the files associated with a commit.
	#{for m=Commits[n].FilesCount}
		${Commit[n].FilesCount[m].Path}
		${Commit[n].FilesCount[m].URL}
		${Commit[n].FilesCount[m].ChangeType}
	#{end}
#{end}
 
or
 
#{for <VariableName>=CommitsCount}
   Content and Issue Mappings. Example: ${Commits[VariableName].Field}
#{end}

 

Iterating Issue Branches

Because it is not known in advance how many branches exist for an issue, you can iterate a section over all the branches of an issue. This allows you to create a table that dynamically grows according to the number of existing branches. The notation is:

Branches FieldsDescription
URL

The URL of the Branch

NameThe name of the Branch
RepositoryName
The name of the repository
RepositoryURL
The URL of the repository

...

#{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>=AffectedVersionsCount}
   Content and Versions Issue Mappings. Example: ${AffectedVersions[VariableName].Field}
#{end}

The documents below demonstrate examples both in Word and Excel template that iterates over the issue's affected versions.

Image Added Iterating_Issue_AffectedVersions.docx

Image Added Iterating_Issue_AffectedVersions.xlsx

...

Iterating Project Versions

You can iterate over all project versions to which 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 sample smaple code
collapsetrue
#{for branchesprojectVersions}
  	${ProjectVersions[n].Name}
	${BranchesProjectVersions[n].URLDescription}
	${dateformat(“dd-MM-yyyy”):ProjectVersions[n].Start date}
	${Branchesdateformat(“dd-MM-yyyy”):ProjectVersions[n].NameRelease date}
  	${BranchesProjectVersions[n].RepositoryNameArchived}
  	${BranchesProjectVersions[n].RepositoryURLReleased}
#{end}
 
or
 
#{for <VariableName>=BranchesCountProjectVersionsCount}
   Content and Project IssueVersions Mappings. Example: ${BranchesProjectVersions[VariableName].Field}
#{end}

 

Iterating Issue Pull Requests

...

The documents below demonstrate examples both in Word and Excel template that iterates over the issue's project versions.

Image Added Iterating_Issue_ProjectVersions.docx

Image Added Iterating_Issue_ProjectVersions.xlsx

...

Iterating Sprints

You can iterate over all sprints to which the issue belongs. The notation is:

Pull Requests Project Versions FieldsDescription
URL

The URL of the Branch

NameThe name of the Branch
RepositoryName
The name of the repository
RepositoryURL

The URL of the repository

CommentsCountCounts the number of comments in the pull request
StatusThe status of the pull request
LastUpdatedThe last time the pull request was updated
PullRequestReviewers.NameThe name of the pull request reviewer
PullRequestReviewers.ApprovedIndicates the approval of the pull request reviewer

You can get information about reviewers from each  pull request:

...

NameThe sprint name
StatusThe sprint status
Code Block
titleExpand to see the smaple code
collapsetrue
#{for sprints}
	${Sprints[n].Name}
	${Sprints[n].Status}
#{end}

or

#{for <VariableName>=SprintsCount}
   Content and Sprints Mappings. Example: ${Sprints[VariableName].Field}
#{end}

The documents below demonstrate examples both in Word and Excel template that iterates over the issue's project versions.

Image Added Iterating_Issue_Sprints.docx

Image Added Iterating_Issue_Sprints.xlsx

...

Iterating Issue History Entries

You can iterate over all issue's changelogs. The notation is:

Project Versions FieldsDescription
AuthorThe user who made the change
CreatedDate of the change
CreatedDateDate of the change
CreatedDateTimeDate of the change
ChangedItemsCountNumber of items changed
Code Block
titleExpand to see the sample smaple code
collapsetrue
#{for pullRequestshistoryEntries}
 
	${PullRequestsHistoryEntries[n].URLAuthor}
  	${PullRequestsHistoryEntries[n].NameCreated}

 	${PullRequestsHistoryEntries[n].RepositoryName}
  	${PullRequests[n].RepositoryURL}
	${PullRequests[n].CommentsCount} (This represents the number of comments in a pull request)CreatedDate}
	${PullRequestsHistoryEntries[n].StatusCreatedDateTime}
	${PullRequestsHistoryEntries[n].LastUpdatedChangedItemsCount}
 
	Here we have the PullRequestReviews where we can get all the reviewers for this pull request.
	#{for m=PullRequests[n].PullRequestReviewers}
 
	#{for i=HistoryEntries[n].ChangedItemsCount}
		${HistoryEntries[n].ChangedItems[i].Field}
		${PullRequestsHistoryEntries[n].PullRequestReviewersChangedItems[mi].NameFrom}

 		${PullRequestsHistoryEntries[n].PullRequestReviewersChangedItems[mi].ApprovedTo}
	#{end}
#{end}
 
or
 
#{for <VariableName>=PullRequestsCountHistoryEntriesCount}
   Content and History IssueEntries Mappings. Example: ${PullRequestsHistoryEntries[VariableName].Field}
#{end}

 

Iterating Issue Builds

...

The documents below demonstrate examples both in Word and Excel template that iterates over the issue's changelogs.

Image Added Iterating_Issue_Histories.docx

Image Added Iterating_Issue_Histories.xlsx

...

Iterating Project Components

You can iterate over all project components. The notation is:

...

Code Block

...

Plans.Key

...

Plans.BuildNumber

...

Image Removed

#{for builds} ${Builds[n].ProjectName} ${Builds[n].ProjectKey} Here we have the each Build Plans where we can get all the individual plans for this project and the correspondent build in existence for this plan. #{for m=Builds[n].Plans} ${Builds[n].Plans[m].Key} ${Builds[n].Plans[m].Name} ${Builds[n].Plans[m].BuildNumber} ${Builds[n].Plans[m].BuildKey} ${Builds[n].Plans[m].BuildDuration} ${Builds[n].Plans[m].BuildFinishedDate} #{end
Code Block
titleExpand to see the sample code
collapsetrue
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 template that iterates over the project components.

Image Added Iterating_Issue_ProjectComponents.docx

Image Added Iterating_Issue_ProjectComponents.xlsx

...

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>=BuildsCountIssuesInEpicCount}
   Content and Issue Mappings. Example: ${BuildsIssuesInEpic[VariableName].Field}
#{end}

 

Iterating Issue Reviews

Because it is not known in advance how many reviews exists for an issue, you can iterate a section over all the pull requests of an issue. This allows you to create a table that dynamically grows according to the number of existing reviews. The notation is: 

...

The review ID, e.g., 1

...

The URL of the review

...

The review status

...

.Field}
#{end}

The documents below demonstrate examples both in Word and Excel template that iterates over the issues in epic.

Image Added Iterating_Issues_In_Epic.docx

Image Added Iterating_Issues_In_Epic.xlsx

...

Iterating JQL Queries

You can iterate issues that are the result of a JQL Query. The syntax is similar to the other iterations, but there is a clause parameter that will receive the JQL Query. A few examples are provided below.

Code Block
titleExpand to see the sample code
collapsetrue
#{for reviews}
  	${Reviews[n].Id}
  	${Reviews[n].URL}
  	${Reviews[n].Status}
  	${Reviews[n].Title}
  	${Reviews[n].Author}
  	${Reviews[n].Moderator}
	
	Here we have the Reviewers for each review where we can get all the individual reviewers for this review.
	#{for m=Reviews[n].Reviewers}
 		${Reviews[n].Reviewers[m].Username}
  		${Reviews[n].Reviewers[m].Completed}
	#{end}
#{end}
 
or
 
#{for <VariableName>=ReviewsCount}
   Content and Issue Mappings. Example: ${Reviews[VariableName].Field}
#{end}a simple example iterating the details of issues from a specified Project:
 
#{for i=JQLIssuesCount|clause=project = DEMO}
   ${JQLIssues[i].Key}
   ${JQLIssues[i].Summary} 
#{end}
 
or a more advanced example iterating the details of the Parent issue from the current Subtask:
 
#{for i=JQLIssuesCount|clause=issuekey = ${ParentIssueKey}}
	${JQLIssues[i].Key}
	${JQLIssues[i].Id}
	${JQLIssues[i].Description}
#{end}

The documents below demonstrate examples both in Word and Excel template with JQL examples.

Image Added JQL.docx

Image Added JQL.xlsx

Info

You can also use a Filter Name or a Filter Id as a clause. For more info, check [http://confluence.xpand-addons.com/display/public/XPORTER/JQL]

Applying filters to Iterations

...

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. For more information on formatters, see Iterations.

The imagedocument 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_with_Filter_and_HighPriority.docx

...

Nested Iterations

You can have multiple levels of iterations inside other iterations. 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. to iterate the comments of each linked issue or the attached images for each subtask.

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:
Code Block
titleExpand to see the sample code
collapsetrue
true
#{for <VariableName1>=LinksCount}
  	#{for j=LinksCount|filter=%{'${Links[j].LinkType}'.equals('duplicates')}}${Links[j].Key} #{end}

...

<VariableName2>=Iteration[n].Count}
		Content here	
	#{end}
#{end}

The document below demonstrates multiple scenarios where nested iterations can be useful.

Nested_iterations.docx

...

Iterating in the same line of the document

You can also possible to iterate values in the same cell in an Excel line of the 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.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
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. 

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

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 skip tostop the next iteration if the current comment is "World", bypassing the Author mapping for this iteration is "World". Here is the template for that:
#{for comments}
Current Comment: ${Comments[n].Body}
#{if (%{'${Comments[n].Body}'.equals('World')})}
#{continuebreak}
#{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 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, not printingif the Authorcurrent of the "World" comment.

Iterating Parent Issues

You can iterate a section over all the parent issues of an issue. This allows you to create a table that dynamically grows according to the information you want to see from parent issues.

Imagine that you have a Jira Issue that contains a Key, Summary, Description and further information. From now on, you are able to get all the information from a parent issue. In order to get those fields, you just need to have the following definition:

...

Code Block
titleExpand to see the sample code
collapsetrue
&{for issues|filter=%{'${IssueTypeNamecomment 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('Sub-taskWorld')})}
    {Parent.Key#{continue}
#{end}
Current Comment Author:  {Parent.Summary}
    {Parent.Description}
    {wiki:Parent.Description}
    {html:Parent.Description}
    {dateformat(“dd-MM-yyyy HH:mm:ss”):Parent.date}
    {emailaddress:Parent.userpicker}
&{end}
 
This example only has a few fields, but this new feature allows you to get all information from a parent issue. ${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:

...

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

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

Code Block
titleExpand to see the sample code
collapsetrue
&{for issues|sortby=IssueTypeName}
${Key} - ${IssueTypeName}
&{end}
Info
titleSorting Criteria

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



Info

Status
colourBlue
titleWiki
indicates that the field supports wiki format. More about here.