Project Audit Trail

3 hours 18 minutes ago
Avatar

Sometimes auditors are asking to produce a full audit trail of the project. This usually happens when they can't find anything bad in the process but still have hopes to leave at least some comments/remarks.

In order to resolve this, here's the complete project audit trail report:
ESQL

SELECT
  HIST.CHANGESET_ID,
  HIST.CHANGE_DATE,
  HIST.USER_NAME AS CHANGED_BY,
  HIST.ARTIFACT_TYPE_NAME,
  HIST.ARTIFACT_ID,
  HIST.ARTIFACT_DESC AS ARTIFACT_NAME,
  HIST.CHANGETYPE_NAME AS CHANGE_TYPE,
  HIST.SIGNATURE_HASH
FROM SpiraTestEntities.R_HistoryChangeSets AS HIST
WHERE HIST.PROJECT_ID = ${ProjectId}

XSLT

 

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">

    <h2>Project Audit Trail</h2>

    <table class="DataGrid" style="width:100%">
      <tr>
        <th>Change ID</th>
        <th>Change Date</th>
        <th>Changed By</th>
        <th>Artifact Type</th>
        <th>Artifact ID</th>
        <th>Artifact Name</th>
        <th>Change Type</th>
        <th>Signed</th>
      </tr>

      <xsl:for-each select="//*[CHANGESET_ID]">
        <xsl:sort select="CHANGESET_ID" data-type="number" order="descending" />
        <tr>
          <td><xsl:value-of select="CHANGESET_ID"/></td>
          <td><xsl:value-of select="CHANGE_DATE"/></td>
          <td><xsl:value-of select="CHANGED_BY"/></td>
          <td><xsl:value-of select="ARTIFACT_TYPE_NAME"/></td>
          <td><xsl:value-of select="ARTIFACT_ID"/></td>
          <td><xsl:value-of select="ARTIFACT_NAME"/></td>
          <td><xsl:value-of select="CHANGE_TYPE"/></td>
          <td>
            <xsl:choose>
              <xsl:when test="string-length(SIGNATURE_HASH) &gt; 0">Signed</xsl:when>
              <xsl:otherwise>Not Signed</xsl:otherwise>
            </xsl:choose>
          </td>
        </tr>
      </xsl:for-each>

    </table>

  </xsl:template>

</xsl:stylesheet>

As usual, please let me know if you find some bugs in the report. Your feedback is appreciated!

0 Replies

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: 3 hours 18 minutes ago
  • Last Reply: 3 hours 18 minutes ago
  • Replies: 0
  • Views: 9