Skip Navigation LinksHome Page > Forums > SpiraTeam Forums > Spira Custom Reports > Reference elements from p...
I need to add a Requirement Number into the Test Steps grid in the Test Case Detailed report.
I noticed from the XML source of the report that the structure of the XML template is based on:
<TestCase>
<TestSteps>...</TestSteps>
<CustomProperties>...</CustomProperties>
<Discussions>...</Discussions>
<Attachments/>
<Requirements>...</Requirements>
<TestRuns>...</TestRuns>
<TestSets>...</TestSets>
<History>...</History>
<Incidents>...</Incidents>
<Releases>...</Releases>
</TestCase>
So Inside of this report's XML template I have a section for displaying the test steps where I need to add Req # as first column:
<xsl:if test="TestSteps/TestStep"> <div class="Title4"> Test Steps: </div> <table class="DataGrid"> <tr> <th>Step</th> <th>Description</th> <th>Expected Result</th> <th>Sample Data</th> <th>Last Status</th> </tr> <xsl:for-each select="TestSteps/TestStep"> <tr> <td> <xsl:value-of select="position()"/> </td> <xsl:if test="string(LinkedTestCaseId)"> <td colspan="3"> <xsl:value-of select="Description" disable-output-escaping="yes"/> '<xsl:value-of select="LinkedTestCaseName"/>' <xsl:for-each select="Parameters"> <i> with <xsl:for-each select="TestStepParameter"> <xsl:value-of select="Name"/> = '<xsl:value-of select="Value"/>', </xsl:for-each> </i> </xsl:for-each> </td> </xsl:if>
Please explain how it works to link to the parent (TestCase) node using <xsl:if test="string(LinkedTestCaseId)"> check and if I can potentially reach into the <Requirements>...</Requirements> node to show the linked Requirements # from "TestSteps/TestStep" node.
I understand that I could add a Custom SQL section (which I already have) but the result of that shows at the bottom of the report and I really only need to add one column to the existing grid to fulfill my requirements so there is no reason to make it complicated. If I need to re-do the whole report in Custom SQL displaying TC, TS and Reqs - this is also too much work and I'm not sure I could get all Custom Properties and all text values correctly in my SQL.
Please help!
Thank you
Hi,
I think this article is applicable to your question: https://www.inflectra.com/Support/KnowledgeBase/KB397.aspx.
Regards,
Elise
And if you have any questions, please email or call us at +1 (202) 558-6885