Confirming Data Setup

Let us first make sure that there are custom properties setup on the requirement artifact and that some of these custom properties have data.

  1. Let us set up  two custom properties "Automatable" and "Contract Work" are set up as text properties.
  2. Let us add four requirements are added with data populated on the custom properties as follows.
RequirementAutomatableContract Work
Requirement 1PresentPresent
Requirement 2PresentAbsent
Requirement 3AbsentPresent
Requirement 4AbsentAbsent

 

The screenshot below shows the data set up.

DataSetup

 

Adding Logic in XSLT

  1. In the custom report that you are created, logic has to be introduced in the XSLT to check for data being present and insert them in the report only "if" data is present. 
  2. Here is a snippet of that logic for just one custom property. You can see that if the custom property is not blank (!='' check), then a row is added to insert that data element. As a result, if the data is not present, a row is not inserted.
  3. This logic should be repeated for every custom property that needs to be checked.
<xsl:if test="CustomProperties/CustomProperty[Name = 'Custom_01']/Value !=''">
 <tr>
  <td width="20%">
	Automatable
  </td>
  <td>
	<xsl:value-of select="CustomProperties/CustomProperty[Name = 'Custom_01']/Value" disable-output-escaping="yes"/>				
  </td>
 </tr>
</xsl:if>

 

Report Output

When this report is being run, the output looks as follows pulling the appropriate custom property when there is data present.

Report Output pulling only those custom properties with data present