You can quickly and automatically create links between multiple artifacts by artifact
attribute.
Before you begin
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 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.
Then, the 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 the links.
Procedure
-
Click the Administration icon and select Manage Project Properties.
Note: If configuration management is enabled for your project, on the
Administration menu, click Manage Component
Properties.
- Click the Artifact Attributes tab. On the Artifact
Attributes page, click New Attribute and create a custom attribute
that is called MyString with a
string
data type.
Note: You can use any custom attribute type if the type is string
and is not a predefined
system attribute.
- Click the Artifact Types tab and select the
Feature attribute from the Artifact Types
section.
- From the Add Attribute page, select the
MyString attribute, and click OK.
-
Click the Artifact tab and then click the Modules
tab. Create a sample module that contains several Feature artifacts.
- Change the column headings in the module to show the new MyString
attribute column and the Linked To column.
The sample module is displayed with the new columns:
- To create links from Feature 1 to the rest of the features, type the ID of each target
artifact (separated by commas) in the MyString column.
- Then, to automatically create the links, select the check boxes that are next to the
artifacts, and right-click Link by Attribute for 5 Artifacts.
- In the Link by Attribute window, select
MyString from the Attribute list and select
Link To from the Link Type list. Click
OK. 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 in the
Link
To column.
- Complete the following steps to create links from feature type attributes between two
modules:
- 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:
- 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:
- 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: