Linking by attribute

You can quickly and automatically create links between multiple artifacts by artifact attribute.

You can use the Link by Attribute function to automatically create, update, and delete links between artifacts based on an attribute value. To use this feature, type the artifact IDs of the target artifacts (separated by commas) in a custom string attribute type, select Link by Attribute and then follow the prompts. You can use this function in a module, a collection, or in any artifact view.
Note: This feature can also be used in conjunction with the CSV round-trip support to handle creating and changing links when you import data.
The following example provides a more thorough explanation of how the Link by Attribute function works. The examples show how to create links between multiple artifacts in a single module and between artifacts in different modules. First, the example shows how to complete these tasks:
  • Create a custom attribute called MyString.
  • Add the MyString attribute to a Feature artifact type.
  • Change the column headings in a sample module to display the MyString attribute.
The following example shows how to add artifact IDs of the artifacts to link to in the MyString attribute, and how to run the Link by Attribute function to automatically create and remove the links.
  1. Click the drop-down menu for the Administration icon Administration icon and select Manage Project Properties.
    Note: If configuration management is enabled for your project, on the Administration menu, click Manage Component Properties.
  2. On the Artifact Attributes page, click New Attribute and create a custom attribute that is called MyString with a data type of string, as shown in the following image:
    screen
    Note: You can use any custom attribute type as long as the type is string and is not a predefined system attribute.
  3. Add the newly created MyString attribute to a Feature artifact type, as shown in the following image:
    screen cap adding attribute to artifact type
  4. Create a sample module that contains several Feature artifacts.
  5. Change the column headings in the module to show the new MyString attribute column and the Linked To column, as shown in the following image:
    screen cap of display settings
    The sample module is displayed with the new columns:
    screen cap of
  6. To create links from Feature One to Feature Two, Feature Three, Feature Four, and Feature Five. To create these links, type the ID of each target artifact (separated by commas) in the MyString column, as shown in the following image:
    type module screencap
  7. Then, to automatically create the links, select the check boxes for the artifacts and click Other Actions > Link By Attribute, as shown in the following image:
    screen cap of link by attribute menu
  8. In the Link by Attribute window, in the Attribute field, select MyString and in the Link type field, select Link To. Click OK.
    link by attribute window
    When Create links for all IDs in the attribute is selected, the links for all the IDs that don't exist is created. To remove the links that are not listed in the attribute, select Remove links that don't have a matching ID.
    The links that you specified are automatically created, as shown in the Link To column in the following image:
    type alt text here
  9. To create a link from Feature 3 to an artifact in another module, such as to Feature 10 in Module Two, enter the artifact ID of Module Two (377) and the ID of Feature 10 (378), separated by a period, as shown in the following image:
    module one screen cap
  10. Then, select Feature Three (in Module One) and Feature 10 (in Module Two) as shown in the following side-by-side view of both modules:
    side by side graphic of mod1 and mod2
  11. Then, run Link By Attribute and enter the Attribute and Link To data in the Link by Attribute window. When you click OK, the link is automatically created in the Link To column in Module One, as shown in the following image:
    screen cap showing new inter module link