Creating custom attributes

You can create custom attributes on source file versions, streams, snapshots, components, and baselines. You define custom attributes in the project area. You can query for custom attributes from the command line interface.

Before you begin

You must have permission to modify the project area where you want to create custom attributes.

About this task

Custom attributes support the extensibility and traceability for artifacts. For example, after you deliver a file, you can record extra comments about a specific file version in a comments attribute. You can write a script that runs a static analysis tool on the team's source code, and saves file-specific errors or warnings into an attribute on specific source file versions. Code inspection information can also be recorded on source code (for example, whether the file version was inspected and who inspected it). You can keep information about what release a baseline is part of, or what build generated a specific snapshot.

Procedure

  1. Navigate to the project area in the administrative web interface. See Logging in for project administrators and team leads (web).
  2. In the project area or team area, click Source Control > Attribute Definition.
  3. On the Source Control - Attribute Definition page, click Add.
  4. In the Add Attribute window, complete the appropriate fields and select the types of objects that allow the custom attribute. If file is selected, in the Behavior when a new file version is created area, select one of the following options:
    • Do not create the attribute: If the custom attribute existed on the previous version of file, it is not created on the new version of the file when you check in your changes.
    • Copy the attribute value from the previous version: If the custom attribute existed on the previous version of the file, it is created on the new version of the file and its value is set to the value of the attribute on the previous version.
    • Reset the attribute value to the default value: If the custom attribute existed on the previous version of file, it is created on the new version of the file and its value is set to the default value that you define in the Default Value field.
    Note: If version of a file or baseline is part of a component that is owned by multiple project areas, you can set a custom attribute only if it defined in all parent project areas.
  5. Click Add.
  6. Click Save.
  7. Optional: To edit an attribute, hover under the Actions column and click Edit Attribute. In the Edit Attribute window, you can change the name, types, default values and check-in behavior (when a new file version is created). Save the changes.
  8. Optional: To delete an attribute, hover under the Actions column and click Delete attribute to delete the attribute.

What to do next

Create custom attributes from the command line interface.