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 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.
Procedure
-
Click the drop-down menu for 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.
-
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:
Note: You can use any custom attribute type as long as the type is string
and is
not a predefined system attribute.
-
Add the newly created
MyString
attribute to a Feature artifact type, as shown
in the following image:
-
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, as shown in the following image:
The sample module is displayed with the new columns:
-
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:
-
Then, to automatically create the links, select the check boxes for the artifacts and click , as shown in the following image:
-
In the Link by Attribute window, in the Attribute
field, select MyString and in the Link type field,
select Link To. 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, as shown in
the
Link To column in the following image:
- 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: