Custom Export Templates

You can create a template for exporting ReqView documents into HTML, CSV, XML or any other structured text format. The template files have Handlebars syntax with {{ moustache }} form.

You can start by downloading example export templates from the ReqView Support site > Download HTML Export Templates section (log in needed).

If you have a custom template then you can use it for exporting the current document as follows:

  1. In ReqView select File > Export > Custom Template menu to open the HTML Export Options dialog.
  2. In the HTML Export Options dialog choose if custom attribute columns will be compacted into the Custom Attributes column, if exported data will be filtered and sorted same as the Requirements Table and if section folding shall be preserved.
  3. In the system folder picker dialog select the destination folder (herein <folder>) storing the exported documents.

The exported file is named according to the document ID with the same extension as the template file (e.g. <folder>/SRS.html). All attachments are stored in a separate attachment folder (e.g. <folder>/SRS_files).

The ReqView exporter passes to each Handlebars template an object model storing information about document objects and their traceability links. Handlebars template describes how the object model is converted into an output text format by means of markup text and custom helpers.

Exported Object Model

Document Properties

The exported object model contains at the top level document properties and a filtered collection of document objects sorted by the default or displayed order:

  • docId - document identifier
  • fileName - file name
  • createdOn - date of document creation
  • createdBy - document author record
    • name
    • email
    • company
  • lastChangedOn - date of the last modification
  • lastChangedBy - last modification author record
    • name
    • email
    • company
  • filter - collection of filtering criterions
    • criterion - filtering criterion definition
  • sort - document sort record
    • attribute - ID of the attributed used for sorting
    • descending - true if sort is descending
  • columns - collection of column records
    • id - the given column identifier, e.g., “description” or a custom attribute identifier
    • icon - icon name for the given
    • userDefined - true if the given column is a custom attribute
    • sortAsc - true if the given column is sorted with ascending order
    • sortDesc - true if the given column is sorted with descending order

Document Objects

Each document object contains attributes, attachments, discussion and links:

  • id - a unique object identifier within the document
  • guid - a globally unique object identifier
  • heading - section heading
  • text - text description
  • deleted - flag set to true if object is marked as deleted
  • level - object level
  • parent - a unique identifier of the parent object within the document
  • attachments - collection of object attachments
    • name - attachment name
    • data - attachment data as base64 string
    • href - relative URL to the attachment file
    • isImage - flag if attachment is an image type
  • discussion - collection of object comments
    • date - comment date
    • author - comment author record
      • name
      • email
      • company
    • comment - comment text
  • link types - collection of object link types

    • linkTypeId - name of the link type
    • links - collection of object links with the given link type
      • id - an identifier of a object connected with the link
      • shortDescription - description of a object connected with the link
  • … and custom attributes

Template Helpers

You can customize templates by expressions or template helpers. An expression is a {{, some contents, followed by a }}. The values returned by a {{ expression }} are HTML escaped. If you don’t want to escape the expression value, use the “triple-stash”: {{{ expression }}}.

For instance, {{ text }} outputs object text description with HTML escaped tags “&lt;p&gt;User shall …&lt;/p&gt;>” while {{{ text }}} outputs the object text description with the original HTML tags “<p>User shall …</p>”.

The whitespaces (e.g. line ends) in the template are preserved into the output text. If you want to remove them from either side use tilde ~ by the braces. For example, {{~ expression }} removes all white spaces before the expression up to the first handlebars expression or non-whitespace character.

Handlebars defines rich set of build-in template helpers allowing to conveniently iterate through an object structure and output object properties using expressions. The most useful of them is the predefined conditional block helper {{#if expression}}{{else}}{{/if}} allowing to render block content based on result of the given expression.

Additionally to the build-in template helpers you can use ReqView custom template helpers described in the next section which simplifies access to the document data model.

You can combine template helpers to generate value of template helper parameters by enclosing the inner helpers in normal brackets. For instance, the following snippet outputs bold text “TODO” if the object status is set to “Draft”:

{{#if (eval state "==" "Draft")}}<b>TODO</b>{{/if}}

HTML


Document Helpers

docName

Syntax: {{docName [docId=<string>]}}

Description: Outputs document name of the current document or a document with the given document ID.

Example: Output name of SRS document:

{{\docName docId="SRS"}}

HTML

eachDocumentObject

Syntax: {{#eachDocumentObject [separator=<string>]}}{{/eachDocumentObject}}

Description: Iterates all document objects in the exported document. You can optionally specify custom separator string by separator parameter.

Example: Output list of document object IDs separated by comma:

{{#eachDocumentObject separator=","}}{{id}}{{/eachDocumentObject}}

HTML


Document Object Helpers

docObjId

Syntax: {{docObjId}}

Description: Outputs the object ID prefixed by the document ID.

shortDescription

Syntax: {{shortDescription [attribute=<attId>] [maxLength=<number>]}}

Description: Outputs short text description (with stripped HTML) of given object attribute or heading / text if attribute parameter is not provided. You can specify maximum number of characters by optional maxLength parameter.

Example: Output object description from heading and text attributes shortened to 80 characters:

{{{shortDescription maxLength=80}}}

HTML

sectionNumber

Syntax: {{sectionNumber}}

Description: Outputs section number as a plain text, e.g. “1.2.3”.

section

Syntax: {{#section [numbering=<bool>] [shiftLevel=<number>]}}{{/section}}

Description: Generates a section heading block with proper style. If its optional parameter numbering is true then outputs also the section number. Optional parameter shiftLevel denotes number of heading level shift.

Example: Output the section number followed by section heading and shift level by 1 to use <h2> tag for the top level:

{{#section numbering=true shiftLevel=1}}{{heading}}{{/section}}

HTML

indentation

Syntax: {{indentation <number>}}

Description: Calculates indentation space from the object level in the document hierarchy. The argument provides number of pixels per level.

Example: Indent a div HTML tag by 10px per level:

<div style="padding-left:{{indentation 10}}">{{shortDescription}}</div>

HTML

attributeValue

Syntax: {{attributeValue <attId>}}

Description: Formats value of the given document object attribute.

Example: Output the text value (e.g. “Implemented”) of the status custom attribute:

{{attributeValue "status"}}

HTML

eachAttachment

Syntax: {{#eachAttachment}}{{/eachAttachment}}

Description: Iterates the attachments of the current document object. The child context has name, data, href and isImage properties.

Example:

{{#eachAttachment}}
{{#if isImage}}
<img src="{{data}}">
<div><em>Image attachment:</em> {{name}}</div>
{{else}}
<div><em>File attachment:</em> {{name}}</div>
{{/if}}
{{/eachAttachment}}

HTML

hasInlinks / hasOutlinks

Syntax: {{hasInlinks [linkTypeId]}}

Description: Returns true if the current document object has an inlink resp. outlink. You can optionally provide a link type ID.

Example:

{{#if (hasInlinks "satisfaction")}}
<span>OK.</span>
{{else}}
<span>Missing satisfaction link!</span>
{{/if}}

HTML

ifHasInlinks / ifHasOutlinks

Syntax: {{#ifHasInlinks <linkTypeId>}}{{/ifHasInlinks}}

Description: Outputs the given block if the current document object has an inlink resp. outlink of the given link type ID. An else block can be optionally provided.

Example:

{{#ifHasInlinks "satisfaction"}}
<span>OK.</span>
{{else}}
<span>Missing satisfaction link!</span>
{{/ifHasInlinks}}

HTML

countInlinks / countOutlinks

Syntax: {{countInlinks [linkTypeId]}}

Description: Returns number of inlinks resp. outlinks of the current document object. You can optionally provide a link type ID.

Example:

{{countInlinks "satisfaction"}}

HTML

eachInlinkType / eachOutlinkType

Syntax: {{#eachInlinkType}}{{/eachInlinkType}}

Description: Iterates incoming resp. outgoing traceability link types for the current document object.

Example:

{{#eachInlinkType}}
<div>{{{linkTypeName}}}:</div>
{{#eachLink}}
<div>{{docObjId}} {{shortDescription maxLength=40}}</div>
{{/eachLink}}
{{/eachInlinkType}}

HTML

eachInlinkWith / eachOutlinkWith

Syntax: {{#eachInlinkWith type=<typeId> [separator=<string>]}}{{/eachInlinkWith}}

Description: Iterates incoming resp. outgoing traceability links of type given by type parameter. You can optionally specify custom separator string by separator parameter. Links are sorted the same way as in the displayed table view.

Example:

{{#eachInlinkWith type="verification" separator=", "}}
<span>{{{docObjId}}}</span>
{{/eachInlinkWith}}

HTML

withParentLink

Syntax: {{#withParentLink}}{{/withParentLink}}

Description: If the parent links are displayed (Edit > Preferences > Show parent links) then it renders the given block with the parent document object context.

Example:

{{#withParentLink}}
<div><em>Parent:</em> {{docObjId}} {{shortDescription maxLength=40}}</div>
{{/withParentLink}}

HTML

hasOriginInlink / hasOriginOutlink

Syntax: {{hasOriginInlink}}

Description: Returns true if origin links are displayed (Edit > Preferences > Show origin and inherited links) and if the given document object has an incoming resp. outgoing origin link.

Example:

{{#if (hasOriginInlink)}}Has Copies{{/if}}
{{#if (hasOriginOutlink)}}Is Copy{{/if}}

HTML

eachOriginInlink

Syntax: {{#eachOriginInlink}}{{/eachOriginInlink}}

Description: If origin links are displayed (Edit > Preferences > Show origin and inherited links) then it iterates object’s copies.

Example:

{{#eachOriginInlink}}
<div><em>Copy:</em> {{docObjId}} {{shortDescription maxLength=40}}</div>
{{/eachOriginInlink}}

HTML

withOriginOutlink

Syntax: {{#withOriginOutlink}}{{/withOriginOutlink}}

Description: If origin links are displayed (Edit > Preferences > Show origin and inherited links) and the given document object is a copy then it set child context to the original object.

Example:

{{#withOriginOutlink}}
<div><em>Origin:</em> {{docObjId}} {{shortDescription maxLength=40}}</div>
{{/withOriginOutlink}}

HTML


Attachment Helpers

imageSize

Syntax: {{imageSize [maxWidth=<number>] [maxHeight=<number>]}}

Description: Outputs width and height attributes of <img> HTML tag describing current attachment image size. You can optionally provide maxWidth or maxHeight parameters to rescale the image.

Example:

<img alt="{{{name}}}" src="{{{data}}}" {{imageSize maxWidth=500}}/>

HTML


linkTypeName

Syntax: {{linkTypeName}}

Description: Outputs the name string of the current link type, e.g. “Satisfies”.

eachLink

Syntax: {{#eachInlink}}{{/eachInlink}}

Description: Iterates traceability links of the current traceability link type for the current document object. Links are sorted the same way as in the displayed table view.

Example:

{{#eachInlinkType}}
<div>{{{linkTypeName}}}:</div>
{{#eachLink}}
<div>{{docObjId}} {{shortDescription maxLength=40}}</div>
{{/eachLink}}
{{/eachInlinkType}}

HTML

hyperlink

Syntax: {{#hyperlink}}{{/hyperlink}}

Description: If the link source resp. target document is included in the HTML export then it creates HTML a tag around the inner block pointing to the link source resp. target object.

Example:

{{#hyperlink}}{{docObjId}}{{/hyperlink}}

HTML

ifSuspect

Syntax: {{#ifSuspect}}{{/ifSuspect}}

Description: Outputs the given block if the link is suspect.

Example:

{{#ifSuspect}}!{{/ifSuspect}}

HTML


Column Helpers

eachColumn

Syntax: {{#eachColumn}}{{/eachColumn}}

Description: Iterates displayed columns of the Requirements Table.

eachDisplayedCustomAttribute

Syntax: {{#eachDisplayedCustomAttribute}}{{/eachDisplayedCustomAttribute}}

Description: Iterates attributes displayed in the Custom Attributes column and sets context id, name, value and rawValue properties to attribute ID, name and formatted resp. unformatted value.

Example:

{{#eachDisplayedCustomAttribute}}
{{#if value}}
<div class="attribute">
<span>{{{name}}}:</span> <span>{{{value}}}</span>
</div>
{{/if}}
{{/eachDisplayedCustomAttribute}}

HTML

columnId

Syntax: {{columnId}}

Description: Outputs column ID, e.g., “description”.

Example:

<tr>
{{#eachColumn}}
<th>{{columnId}}</th>
{{\eachColumn}}
</tr>

HTML

columnName

Syntax: {{columnName [<colId>]}}

Description: Outputs column name of the current column in eachColumn context or name of the given column if colId argument is provided.

Example:

<tr>
{{#each columns}}
<th><strong>{{columnName id}}{{#if sortAsc}}&#x25B2;{{/if}}{{#if sortDesc}}&#x25BC;{{/if}}</strong></th>
{{/each}}
</tr>

HTML

isColumn

Syntax: {{isColumn <colId>}}

Description: Returns true if the current column matches the given column ID.

Example:

<tr>
{{#eachColumn}}
{{#if (isColumn "id")}}
<td><a id="{{id}}"></a>{{docObjId}}</td>
{{/if}}
{{/eachColumn}}
</tr>

HTML

isTemplateColumn

Syntax: {{isTemplateColumn}}

Description: Returns true if the current column is a template column.

columnAttributeValue

Syntax: {{columnAttributeValue}}

Description: Outputs value of the attribute corresponding to the current column.

templateColumnValue

Syntax: {{templateColumnValue}}

Description: Outputs value of the attribute corresponding to the current column.

Example:

<tr>
{{#eachColumn}}
{{#if (isTemplateColumn)}}
<td>{{{templateColumnValue (columnId)}}}</td>
{{/if}}
{{/eachColumn}}
</tr>

HTML


Formatting Helpers

formatString

Syntax: {{formatString <string> [maxLength=<number>] [newlines=<bool>]}}

Description: Formats a value as a string (strip HTML tags). You can optionally provide maxLength parameter with a maximum number of string characters. If the optional parameter newlines is true then all p, li and br end tags are replaced by line feed (\n, 0x0A) characters.

Example:

{{{formatString text maxLength=20}}}

HTML

formatJSONString

Syntax: {{formatJSONString <string>}}

Description: Formats a string value as a JSON string.

formatXHTML

Syntax: {{formatXHTML <string> [paragraphClass=<string>] [charClass=<string>]}}

Description: Formats a value as XHTML. You can optionally provide paragraphClass parameter with a paragraph class name for p or div tags or charClass parameter with an inline class name for span tag.

Example:

<div>{{columnName}}:</div>
<div>{{{formatXHTML columnAttributeValue charClass="attrValueChar" paragraphClass="attrValuePar"}}}</div>

HTML

formatPrefixedXHTML

Syntax: {{#formatPrefixedXHTML <string> [paragraphClass=<string>] [charClass=<string>]}}{{/formatPrefixedXHTML}}

Description: Formats a value as XHTML with a custom prefix given by the child block. You can optionally provide paragraphClass parameter with a paragraph class name for p or div tags or charClass parameter with an inline class name for span tag.

Example: Output value of text attribute of the current document object. If heading attribute is not set then insert at the start of the first paragraph the document object ID.

{{#formatPrefixedXHTML text paragraphClass="text"}}
{{#unless heading}}<span>[{{docObjId}}]</span>{{/unless}}
{{/formatPrefixedXHTML}}

HTML

formatDate

Syntax: {{formatDate <date>}}

Description: Formats a date value (ISO 8601) using “YYYY-MM-DD” format, e.g., “2015-09-01”.

formatTime

Syntax: {{formatTime <date>}}

Description: Formats a time value (ISO 8601) using “hh:mm” format, e.g., “16:00”.

formatDateTime

Syntax: {{formatDateTime <date>}}

Description: Formats a date/time value (ISO 8601) using “YYYY-MM-DD hh:mm” format, e.g., “2015-09-01 16:00”.


CSV Output Helpers

csvSeparator

Syntax: {{csvSeparator}}

Description: Outputs CSV separator set in the Preferences dialog.

formatCSVColumn

Syntax: {{formatCSVColumn <value>}}

Description: Formats given value as a CSV column (escapes double quotes, line ends, …).

Example:

{{formatCSVColumn id}}{{csvSeparator}}{{formatCSVColumn text}}

HTML

formatBlockCSVColumn

Syntax: {{#formatBlockCSVColumn}}{{/formatBlockCSVColumn}}

Description: Formats given value as a CSV column (escapes double quotes, line ends, …).

Example: Output IDs of all document objects linked to the current document object with verification link type.

{{~#formatBlockCSVColumn}}
{{~#eachInlinkWith type="verification" separator=" "}}{{docObjId}}{{/eachInlinkWith}}
{{~/formatBlockCSVColumn}}

HTML

formatAttributeCSVColumn

Syntax: {{formatAttributeCSVColumn <attrId>}}

Description: Formats value of the given document object attribute as a CSV column.

Example: Output CSV value of heading system attribute:

{{formatAttributeCSVColumn "heading"}}

HTML

formatSystemAttributeCSVColumn

Syntax: {{formatSystemAttributeCSVColumn <attrId>}}

Description: Formats value of the given document object system attribute as a CSV column.

formatCustomAttributeCSVColumn

Syntax: {{formatCustomAttributeCSVColumn <attrId>}}

Description: Formats value of the given document object custom attribute as a CSV column.


Expressions Helpers

eval

Syntax: {{eval <lvalue> <operator> <rvalue>}}

Description: Evaluates an expression given by three arguments - left value, binary operator and right value. The binary operator can be + (add), - (subtract), * (multiply), / (divide), == (equal), != (not equal), < (less), <= (less or equal), > (greater), >= (greater or equal), && (logical and), || (logical or).

Example: Multiply value of severity, probability and detectability attributes in project risks document:

{{eval (eval severity "*" probability) "*" detectability}}

HTML

Example: Display warning if document object type attribute is set to “Req” and the document object has no incoming link.

{{#if (eval type "==" "Req") }}
{{#unless (hasInlinks)}}
<div><b>Warning:</b> Missing incoming link!</div>
{{/unless}}
{{/if}}

HTML

ifEqual

Syntax: {{#ifEqual <value> <value>}}{{/ifEqual}}

Description: Compares two arguments and outputs the block only if both arguments are equal.

Example: Output document object ID only if value of type attribute equals to “Req” string.

{{#ifEqual type "Req"}}<span>{{docObjId}}</span>{{/ifEqual}}

HTML

var

Syntax: {{var <varId> <value>}}

Description: Declares a variable with the given ID and sets its initial value.

Example:

{{var "x" 0}}

HTML

get

Syntax: {{get <varId>}}

Description: Outputs value of the variable with the given name.

Example: Output the initial value of variable x which is 0.

{{var "x" 0}}
<div>x={{get "x"}}</div>

HTML

set

Syntax: {{set <varId> <value>}}

Description: Sets the given variable to the given value. The value should be of the same type as the initial value.

Example: Set value of variable x to the value of document object attribute estimate.

{{set "x" estimate}}

HTML

incr

Syntax: {{incr <varId>}}

Description: Increments value of the given number variable.

Example: Count number of document objects in c variable.

{{var "c" 0}}
{{eachDocumentObject}}{{incr "c"}}{{/eachDocumentObject}}
<div><b>Count:</b> {{get "c"}}</div>

HTML

decr

Syntax: {{decr <varId>}}

Description: Decrements value of the given number variable.

searchString

Syntax: {{searchString <string> <string>}}

Description: Searches a string given by the first argument if contains a substring given by the second argument.

Example: Returns true if text attribute of a document object contains “shall” substring.

{{searchString text "shall"}}

HTML

searchRegexp

Syntax: {{searchRegexp <string> <pattern> [flags=<string>]}}

Description: Searches a string given by the first argument if it matches a regular expression pattern given by the second argument. You can optionally provide flags parameter for the regular expression.

Example: Returns true if text attribute of a document object matches “shall” keyword with ignoring case.

{{searchRegexp text "\Wshall\W" flags="i"}}

HTML

replaceString

Syntax: {{replaceString <string> <string> <string>}}

Description: Returns a string given by the first argument with replaced substring given by the second argument by a string given by the third argument.

Example: Output a string with replaced “shall” substring in text document object attribute by “<b>shall</b>”.

<div>{{{replaceString text "shall" "<b>shall</b>"}}}</div>

HTML

replaceRegexp

Syntax: {{replaceRegexp <string> <pattern> <string> [flags=<string>]}}

Description: Returns a string given by the first argument with pattern given by the second argument replaced by a string given by the third argument. You can optionally provide flags parameter for the regular expression.

Example: Output a string with replaced all occurrences of “shall” keyword in text document object attribute content by “<b>shall</b>”

<div>{{{replaceRegexp text "(\W)(shall)(\W)" "$1<b>$2</b>$3" flags="g"}}}</div>

HTML

debug

Syntax: {{debug}}

Description: Outputs information about properties available in the current context.

Example: Output debug information about all set document object attributes (heading, text, …).

<!-- {{{debug}}} -->

HTML

Example Templates

This section provides some examples of complete custom export templates. You can download the full example export templates from the ReqView Support site > Download HTML Export Templates section (log in needed).

HTML Table

The following template outputs the current document as an HTML table with Id, Description and Status columns:

<table id="reqsTable">
<!-- Heading of the requirements table -->
<thead>
<tr>
<th>ID</th>
<th>Description</th>
<th>Status</th>
</tr>
</thead>
 
<!-- Table with list of requirements -->
<tbody>
{{#eachDocumentObject}}
<tr>
<td><a id="{{id}}"></a>{{id}}</td>
<td>
{{#section numbering=true}}{{{heading}}}{{/section}}
{{{text}}}
{{#eachAttachment}}
<div>
{{#if isImage}}
<img src="{{data}}"></br>
<em>Image attachment:</em> <span>{{name}}</span>
{{else}}
<em>File attachment:</em> <span>{{name}}</span>
{{/if}}
</div>
{{/eachAttachment}}
</td>
<td>{{attributeValue "status"}}</td>
</tr>
{{/eachDocumentObject}}
</tbody>
</table>

HTML

MS Word HTML

The following template outputs HTML with book layout containing id, heading, text system attributes, displayed custom attributes and attachments.

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>{{docName}}</title>
</head>
<body>
{{#eachDocumentObject}}
<a name="{{id}}" id="{{id}}"></a>
<!-- Document object description -->
{{#if heading}}{{#section numbering=false}}{{{heading}}}{{/section}}{{/if}}
{{#formatPrefixedXHTML text paragraphClass="text"}}
{{#unless heading}}<span class="id">[{{docObjId}}]</span> {{/unless}}
{{/formatPrefixedXHTML}}
<!-- Document object attachments -->
{{#eachAttachment}}
<p class="attachment">
<span class="attachmentInfo">Attachment:</span>
{{#if href}}
<a href="{{href}}">{{{name}}}</a>
{{#if isImage}}<br><img src="{{href}}" {{imageSize maxWidth=700}}>{{/if}}
{{else}}
{{{name}}}
{{/if}}
</p>
{{/eachAttachment}}
<!-- Displayed document object custom attributes -->
{{#eachDisplayedCustomAttribute}}
{{#if value}}
<div class="attribute">
<span class="attributeInfo">{{{name}}}:</span>
{{{formatXHTML value charClass="attributeValueChar" paragraphClass="attributeValuePar"}}}
</div>
{{/if}}
{{/eachDisplayedCustomAttribute}}
</div>
{{/eachDocumentObject}}
</body>

HTML

The HTML can be easily imported into MS Word. Note that the HTML template contain the document content marked with HTML tags containing class names without any CSS styling.

This allows easy customization using predefined Word styles in a MS Word template in which the exported HTML is inserted, see Import Into MS Word documentation section.

CSV Export

The following example template outputs CSV file with values of id, section, heading, text and status document object attributes. The tildes are used for trimming white spaces to not break CSV format.

"ID"{{{csvSeparator}}}"Section"{{{csvSeparator}}}"Heading"{{{csvSeparator}}}"Text"{{{csvSeparator}}}"Status"\
{{#eachDocumentObject}}
{{~{formatCSVColumn (docObjId)}}}
{{~{csvSeparator}}}
 
{{~#if (sectionNumber)}}
{{~{formatCSVColumn (sectionNumber)}}}
{{~else}}
{{~#withParentLink}}{{~{formatCSVColumn (sectionNumber)}}}{{/withParentLink}}
{{~/if}}
{{~{csvSeparator}}}
 
{{~#if heading}}
{{~{formatAttributeCSVColumn "heading"}}}
{{~else}}
{{~#withParentLink}}{{~{formatAttributeCSVColumn "heading"}}}{{/withParentLink}}
{{~/if}}
{{~{csvSeparator}}}
 
{{~{formatAttributeCSVColumn "text"}}}
{{~{csvSeparator}}}
 
{{~{formatAttributeCSVColumn "status"}}}
{{~{csvSeparator}}}
{{/eachDocumentObject}}

Text only

JSON Export

The following example template outputs JSON file with values of id, section, heading and text document object attributes.

[
{{#eachDocumentObject separator=", "}}
{
"id": {{formatJSONString (docObjId)}},
"section": {{formatJSONString (sectionNumber)}},
"heading": {{formatJSONString heading}},
"text": {{{formatJSONString text}}}
}
{{~/eachDocumentObject~}}
]

Text only

Traceability Report

You can easily create a HTML export template generating a traceability report with a custom layout, for instance, exploring which functionality has missing tests and which functionality has been verified by passed tests.

Let’s check a concrete example of a top-down traceability report displaying the highest level business needs (NEEDS) satisfied by detailed functional requirements (SRS) verified by test cases (TESTS).

HTML report:

End-to-end traceability report

Preview of the HTML template:

End-to-end traceability report

HTML template snippet rendering the Traceability column:

<ul>
{{#eachInlinkWith type="satisfaction"}}
<li>
<span>{{docId}}-{{id}}: {{shortDescription}}</span>
<span>{{status}}</span>
<ul>
{{#eachInlinkWith type="verification"}}
<li>
<span>{{docId}}-{{id}}: {{shortDescription maxLength=40}}</span>
<span>{{status}}</span>
</li>
{{/eachInlinkWith}}
</ul>
</li>
{{/eachInlinkWith}}
</ul>

HTML

The snippet first uses eachInlinkWith block helper to iterate all incoming satisfaction traceability links of the given NEEDS user story. For each such link it renders SRS requirement ID, short description (heading or text attributes) and value of status custom attribute.

Then still in the context of the linked SRS requirement, the snippet analogically uses eachInlinkWith helper to iterate all incoming verification links and for each TEST object it renders test ID, short description and value of status custom attribute.

Updated for version 2.5.0