This article describes how to create a relationship type between issues and an item type. As mentioned in, Understanding Relationships Between Issues and Items, relationships must be configured by project, and, you can define multiple relationship types within a project.
Creating a New Relationship
The first step is to configure a new relationship in the project.
- In the Setup menu, select Relationships.
- Right-click on the Relationships pane and select Add new relationship.
The New relationship dialog will display.
- Enter a SID for the new relationship type. This cannot be changed after the relationship is created.
- Enter a Name for the relationship type. This can be changed at any time.
- Enter a Source name. Think of this name as the role the issue will play in the relationship. This can be changed at any time.
- Enter a Ref name. This is the designation of the other object (in this example, an item type) in the relationship. Again, this name should identify the role that the item will play in the relationship. This name will display under Relationships in the issue view. This can be changed at any time.
- Select a Ref multiplicity to indicate the number of object types (in this example, item types). Possible values are "List" (multiple) or "Single". Note that "Single" relationships will be listed in the Attributes section of the issue editor. Ref multiplicity cannot be changed after the relationship is created.
- Enter a Ref type by clicking on Select item type. The Select type dialog will display. The Ref type can be changed after the relationship type has been created by changing the item type to some other item type.
- Check Floating if you want the relationship to always point to the last version of the item. For example, if an item that has links to issues is released and a new version is created, all of its linked issues will move to the next version of the item. This can be changed at any time.
- Click OK to save the new relationship type.
- Repeat the above steps for each desired relationship type.
If you need to make changes to or delete a configuration, Edit and Delete options are available if you right-click on the relationship.
Enter a configuration in the Edit XML dialog.
The configuration is expressed by the <RelationshipConfig> element.
The optional <Editor> specifies the type of dialog used for selecting the Ref obj objects in the relationship.
The attribute type indicates the type of dialog used for the selection. Currently supported values are: "dropdown". If the attribute is not specified, a default selection dialog will be used.
The optional attribute width indicates the width that should be used for the dialog.
The optional sub-element <VersionInfo> tells that the item version should be indicated in the dialog.
<Constraint> expresses the condition that must be fulfilled for a correct relationship. The constraint is further used by the editor to list alternatives that match the constraint.
The sub-element <FromItem> with the mandatory id attribute specifies an item according to its ID, to be used as a base for selecting alternative items to be used in the relationship.
The sub-element <Path> defines the path of the parts to be followed from the <FromItem> item, according to SystemWeaver Path queries.
<RelationshipConfig> <Editor type="dropdown" width="200"> <VersionInfo /> </Editor> <Constraint> <FromItem id="x04000000000A00C1"> <Path>/ISSE</Path> </FromItem> </Constraint> </RelationshipConfig>
Given the above constraint on the "Documents" relationship called "Section", users will be presented with a drop-down list of valid parts to link the issue to. All of the parts meet the definition in the constraint and they can only select a single value.
Activating the Relationship Type
Once the relationship type is created, to be able to use it, you must include it in the configuration of the Issue Type(s) for which you want it to apply. When applied, a user will be then be able to choose this type of relationship link between an item and an issue of this type.
- In the Setup menu, select Issue Types.
- Select the issue type for which you want the new relationship to be available for use. The Issue Type's configuration will display to the right.
- On the Definition tab, the Included Relationships section will display all available, defined relationships in the project. Right-click on the relationship type and select Include. You can change this at any time to Exclude.
The relationship type is now available when users link items of the type selected as Ref type in the relationship configuration. In the below example, a "Function requirement" item type has been copied and can be pasted to issues of type "Review Issue" as a generic Item Reference, a "Requested" type or an "Implemented" type.