Distinguish between top-level requirements and child requirements

When developing custom reports you may find it useful to treat nested requirements differently than top-level requirements.  How you distinguish between the two types of requirements depends on your version. If you are running version 2011 or later, you may use the IsTopLevel or IsNested property. For example, to list only the top-level requirements:

$listRequirementsSortID where IsTopLevel = True $ID $Name

In this example, an if statement is used to add a section when the requirement is nested:

$repeatRequirementsSortID
$ID $Name
$if IsNested = True
This is a child requirement.  The parent is: $ParentID
$endif
$endrepeatRequirements

If you are running version 2010 R2 or earlier, you may use the OwningRequirement property.  This property returns the name of the parent requirement if the current requirement is nested, otherwise it’s empty.

The two examples above would be rewritten as follows:

$listRequirementsSortID where OwningRequirement = '' $ID $Name
$repeatRequirementsSortID
$ID $Name
$if OwningRequirement <> ''
This is a child requirement.  The parent is: $ParentID
$endif
$endrepeatRequirements
Have more questions? Submit a request
Was this article helpful?
0 out of 0 found this helpful

Comments

Powered by Zendesk