Custom Requirements Traceability Report

Tuesday, November 28, 2017 6:45:07 PM

A customer wanted a RTM report that looped per row for each requirement, rather than having a set of requirements IDs concatenated with commas:

his section displays a list of all the requirements with the associated test cases/requirements.

Req #NameTypeStatusRelease #Test TraceabilityRequirements Traceability
RQ4Ability to add new books to the systemFeatureDeveloped1.0.0.0.0001TC2,TC13,TC8RQ6
RQ4Ability to add new books to the systemFeatureDeveloped1.0.0.0.0001TC2,TC13,TC8RQ30
RQ5Ability to edit existing books in the systemFeatureTested1.0.0.0.0001TC3,TC8RQ57
RQ5Ability to edit existing books in the systemFeatureTested1.0.0.0.0001TC3,TC8RQ7
RQ5Ability to edit existing books in the systemFeatureTested1.0.0.0.0001TC3,TC8RQ31
RQ6Ability to delete existing books in the systemFeatureTested1.0.0.0.0002TC8,TC12RQ4
RQ7Ability to associate books with different subjectsFeatureDeveloped1.1.0.0.0001TC4,TC8RQ5
RQ57Ability to report on book editionsFeatureAccepted TC4,TC2,TC5RQ5
RQ30Creating a new book in the systemUse CaseCompleted TC2RQ4
RQ31Editing an existing book in the systemUse CaseCompleted TC3RQ5

 

1 Replies
Tuesday, November 28, 2017 6:45:36 PM
Avatar
re: inflectra.adam on Tuesday, November 28, 2017 6:45:07 PM

Here's the XSLT you should use for this report:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  <xsl:template match="/RequirementData">
    <table class="DataGrid" style="width:100%">
      <tr>
        <th>Req #</th>
        <th>Name</th>
        <th>Type</th>
        <th>Status</th>
        <th>Release #</th>
        <th>Test Traceability</th>
        <th>Requirements Traceability</th>
      </tr>
      <xsl:for-each select="Requirement">
		  <xsl:for-each select="Requirements/ArtifactLink">
				<tr>
				  <td>
					RQ<xsl:value-of select="../../RequirementId"/>
				  </td>
				  <td>
					<xsl:attribute name="style">
					  padding-left: <xsl:value-of select="string-length(../../IndentLevel)*2"/>px;
					</xsl:attribute>
					<xsl:if test="../../IsSummary='True'">
					  <b>
						<xsl:value-of select="../../Name"/>
					  </b>
					</xsl:if>
					<xsl:if test="../../IsSummary='False'">
					  <xsl:value-of select="../../Name"/>
					</xsl:if>
				  </td>
				  <td>
					<xsl:value-of select="../../RequirementTypeName"/>
				  </td>
				  <td>
					<xsl:value-of select="../../RequirementStatusName"/>
				  </td>
				  <td>
					<xsl:value-of select="../../ReleaseVersionNumber"/>
				  </td>
				  <td>
					<xsl:for-each select="../../TestCases/TestCase">
					  <xsl:if test="position() > 1">,</xsl:if>
					  TC<xsl:value-of select="TestCaseId"/>
					</xsl:for-each>
				  </td>
				  <td>
					  RQ<xsl:value-of select="ArtifactId"/>
				  </td>
				</tr>
			</xsl:for-each>
      </xsl:for-each>
	</table>
  </xsl:template>
</xsl:stylesheet>

 

Statistics
  • Started: Tuesday, November 28, 2017 6:45:07 PM
  • Last Reply: Tuesday, November 28, 2017 6:45:36 PM
  • Replies: 1
  • Views: 44