Lesson 4: Add a custom attribute

Create a custom attribute and link a value to the variable you created in the previous lesson.

About this task

Custom attributes must be linked to variables or other attributes. This lesson outlines assigning the custom attribute to a query named Attribute. The output is to contain the value for each attribute contained in the Attribute query. In the introduction to this tutorial, these attributes were listed: Planned for, Archived, and Approved by. The value for each of these attributes display when the condition is met.

Procedure

  1. In the Data Source Schemas view, right-click PRRequirements.
  2. Click Add special attribute.
  3. For the name, enter customAttrib.
  4. In the Query field, expand Attributes > Attribute.
    The queries that are listed here are the sub-queries under the query in which you added the special attribute. If a query does not have an attribute or simple element within it, there is nothing to use for a value or condition in the special attribute, so therefore, the query does not appear in this list. Attributes is a custom query for this tutorial.
  5. For the Value, select Attribute.
  6. In the dropdown menu, select Value (string).
  7. Select the Use condition check box.
  8. For the Attribute condition, select Name (string).
  9. For the Variable, select the name of the variable, customAttrib.
    Conditions for custom attributes are always two values that are equal to each other. So when the variable is the name of one of the attributes in the data, Planned for, Archived, or Approved by, the value for that attribute displays.
    New special attribute window
  10. Click OK.
  11. In the Data Source View, expand Project > Requirements > PRRequirement.
  12. Drag the customAttrib attribute into the second cell in the second row.
  13. Save the changes.

Results

Result:
Template results

Lesson checkpoint

You learned how to create a custom attribute and link a value to a variable.