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.


Prerequisites

  • You must have "Change" access rights to the CMS project.
  • A CMS project exists and has at least one Issue Type configured.
  • The item type, to which you want to create relations to, exists.

Creating a New Relationship

The first step is to configure a new relationship in the project.

  1. In the Setup menu, select Relationships.
  2. Right-click on the Relationships pane and select Add new relationship.


    The New relationship dialog will display.

  3. Enter a SID for the new relationship type. This cannot be changed after the relationship is created.
  4. Enter a Name for the relationship type. This can be changed at any time.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. Click OK to save the new relationship type.
  11. 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.



Configuring Constraints

There is an option to configure constraints for a relationship between issues and items. A constraint limits the relationship to a specific item's parts. To configure, you must first have created the relationship as described above, and it must use Ref multiplicity "Single".


Select the relationship and click Edit Config.


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.


Example

<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.


Result


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. 

  1. In the Setup menu, select Issue Types
  2. 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. 
  3. 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.