Configuring dependencies between attributes
You can configure artifacts in Project Tracker so that when a user specifies a value for an attribute or has a particular role, other attributes are affected. For example, in a project that contains a Defect artifact type, you may want users to always input a value for the Priority attribute when entering a new defect. Also, if the user selects the Component attribute, you may want the Subcomponent, Version, and Target Milestone attributes to be filtered so that the user can only choose options that are relevant to that component.
The ability for some attributes to control the behavior of other attributes is known as attribute dependency. An attribute dependency rule defines the effect that a source attribute value has on one or more target attribute values. For example, suppose that you define a Defect artifact type with the following attributes:
| Attribute name |
Possible values |
| Status |
New, Open, Code Change, Verified |
| Resolution |
None, Fixed, Duplicate, Closed, Reopened |
You can define a rule for these attributes as follows:
| If |
Then |
| Status=New |
Resolution=None, Duplicate or Closed |
| Status=Open |
Resolution=None, Duplicate or Closed |
| Status=Code Change |
Resolution=Fixed |
| Status=Verified |
Resolution=Closed or Reopened |
You can define an attribute dependency rule that references specific users at the project level. Rules that
reference specific users cannot be created at the global (administrative) level.
Attribute dependency rules may be of two types:
About dependency rules that perform an action
In an action-based rule, you configure an entry condition and one or more actions to be taken based on the entry condition. Each action can either set an attribute's value or make it required for a user to supply a value for an attribute.
An action-based dependency rule has the following basic structure:
If attribute A=value B and/or user role=value C, then do X, Y and Z
The entry condition (the "if" part of the rule) consists of one user role and one attribute, maximum. Examples:
If Priority=High and User Role=Developer
If Target Release=3.5
If User Role=Project Owner
The action part of the rule can either:
- Set a value based on an entry condition.
- Make an attribute required.
About actions that set a value
An action-based dependency rule changes the value of a target attribute based on the value of the entry condition attribute. For example, suppose that you create the following rule for the Defect artifact type:
If Status=Code Change, then Resolution=Fixed
This rule indicates that if a user changes the status of a defect to Code Change, the Resolution field automatically is set to the value Fixed.
About actions that make an attribute required
You can define a rule that requires a user to set the value for a target attribute, that is,
if a user sets a value in A, he or she is required to set the value of B. For example, suppose
that you create the following rule:
If Priority=P1, then Assignee=Required and Version To Fix In=Required
If the user sets the defect priority to P1, this rule requires the user to
provide a value for the Version To Fix In field. As another example, if the user is a
developer and sets the priority to High, the following rule requires the user to provide comments:
If Priority=High and User Role=Developer, then Comments=Required
About rules that use an attribute option filter
You can define an attribute dependency rule in which the value of the source attribute determines what target attribute values are available to the user. This is known as an attribute option filter. For example, suppose that a Defect artifact has the following attributes:
| Attribute name |
Possible values |
| Severity |
Low, Medium, High |
| CC |
Alice, Bob, Tom, Dave, and Tina |
You can write an option filter rule as follows:
| If |
Then |
| Severity=Low |
CC=Alice |
| Severity=Medium |
CC=Alice and Bob |
| Severity=High |
CC=Alice, Bob, Tom, Dave, and Tina |
Both the source and target in this type of rule must be single-select
or multi-select list attributes that have one or more active options.
Evaluation of attribute dependency rules
When an artifact is loaded, the following attribute dependency rules are evaluated:
- Rules that set default values for attributes that are used in the artifact.
- Rules that are enforced without regard to any particular attribute.
- Option filter rules, if values have been set by an artifact entry template.
When an artifact is submitted, the following attribute dependency rules are evaluated:
- Options that are set for an artifact must match any option filter rules.
- Required attributes must be provided.
- Defaults are set for attribute values.
When a saved artifact is edited, the following rules are evaluated:
- Values for attributes must match any attribute option filters (unless a value was set before the rule was created).
- Required attributes must be provided.
About inheritance of dependency rules
A project automatically uses global rules for an artifact type, unless the project owner has deactivated the global rule. If a rule is locked by the global administrator, the rule cannot be deactivated.
If an attribute is used as a target by a global rule, it is not available to be used as a target in a local project.
Starting a rule definition
The path for starting a new rule depends on the role assigned to you.
To start an attribute dependency rule (project owner)
- Click the Projects tab, then click the link for a project.
- Click the Project Tracker link in the left navigation pane.
- Click Manage Artifact Types in the left navigation pane.
- Click the link for the artifact type for which you want to create a dependency rule.
- At the bottom of the page, in the Attribute Dependency Rules section, click Add New.
The Create New Project Rule Page is displayed.
To start an attribute dependency rule (domain administrator)
- Click the Administration tab.
- Click the Artifact Types link in the navigation pane.
- Click the link for an artifact.
- At the bottom of the page, in the Attribute Dependency Rules section, click Add New.
The Create New Rule Page is displayed.
Creating an action-based dependency rule
An action-based dependency rule does one of the following:
- Sets a value for a target attribute.
- Makes it required for a user to enter a value for a target attribute.
To create entry conditions for a new action-based rule
- Begin a new rule, as described in Starting a rule definition.
The Create New Rule page is displayed.
- Select Action-Based Dependency rule and click Continue.
- Provide a Name and a Description.
- Click the radio buttons that correspond to the role and attribute characteristics that constitute the entry condition:
| Entry field |
Description |
| Conditional Role(s) |
Specific Role-This may be any user role that you have added to this project if you are a domain
administrator. (User roles are defined on the Administration tab, from the Roles link in the left navigation pane.)
The user's role or roles are assigned when the user is added as a project member.
Any Role-Everyone applies to this condition. For example, a rule that has Any Role and Any Attribute selected is equivalent to "always."
To Be Determined-You will set this value later. Note that if you specify set a specific conditional role and the role is later deleted, the setting automatically changes to To Be determined.
|
| Conditional Attribute |
Specific Attribute-Only single-select list attributes, multi-select list attributes, and state attributes that are included in the artifact type are allowed in conditional attributes. If this list is empty, all available attributes may already be used in a dependency rule, or there are no appropriate attributes in the artifact type. In either of these cases, select the artifact type, add list or state attributes, and group them in an attribute group. The new attributes will appear in this list.
Any Attribute-This condition will evaluate to true no matter what attribute is selected. For example, a rule that is defined as applicable to Any Role and Any Attribute is equivalent to "always."
To Be Determined-The same as for Conditional Role(s). |
If there are no roles or attributes displayed in the Any Role or Any Attribute drop-down lists, you must add them to this artifact type, then create the rule.
Note: Clicking in the role or attribute list box has no effect unless the Specific Role radio button is also selected.
- Click Continue.
- If you selected a specific attribute, go to the next step.
If you selected Any Attribute or To Be Determined as the conditional attribute, a confirmation page appears.
At the bottom of the page, the Actions section states that no actions have yet been configured. To configure the action, see To create "Set a value" actions for a dependency rule or To create "make required" actions for a dependency rule.
- If you selected a specific attribute, a page is displayed that allows you to select a value or values for this attribute.
For example, for an attribute named Status, you might select a value of New to indicate that when a user sets the value of Status to New, an action (to be defined) will be taken.
- Click Continue.
The message "Your rule was saved" appears at the top of the page. At the bottom of the page, the Actions section will state that no actions have been configured for this rule.
- To configure the action, see To create "Set a value" actions for a dependency rule or To create "make required" actions for a dependency rule.
To create "Set a value" actions for a an action-based dependency rule
- Begin a new rule, as described in Starting a rule definition.
- Create a new entry condition for the rule.
A
summary of the dependency rule is displayed. At the bottom of the page, the Actions section will state that no actions have yet been configured.
- Click Add New.
- On the Add Project Conditional Action page (Project Owner) or Add Conditional Action page (Domain Administrator), select Set a Value and click Continue.
A page containing a Target Attribute section is displayed.
- Select one of the following:
- Specific - You are ready to choose a target attribute.
If no attributes appear in the selection list, add attributes to this artifact type and create an attribute group that contains the artifacts. The attributes must be single-select or multi-select list type.
- To be determined - You will choose the target attribute later.
If you specify a target attribute and it is later deleted, the setting for this action automatically changes to To Be Determined.
- Click Continue.
If you chose To Be Determined, go to Step 10.
If you chose a specific attribute, the page is refreshed to display a Target Value section.
- If the target is a selection-list attribute, go to step 8.
If the target is an input-type attribute, enter the value to set for the target attribute, and select one of the following:
- Make Default - Sets this value if no other value has been supplied.
- Replace Existing - Sets this value whether or not another value has already been supplied.
- If the target is a selection-list attribute, you must indicate what potential values to assign.
You may either pick from a drop-down list, or if the target attribute value is a list of users, you would:
- Click the Edit Users button.
- On the Add Users page, click Edit Users.
- Check the box next to the name for each user who you want to add.
- Click Add Selected to Assignee List.
- Click Done.
- In the Behavior section, specify whether the target value or values are:
- To be added to the list.
- To be set as the default.
- To replace any existing values that the user supplies.
- Click Done.
A message is displayed, "Your action was saved." At the bottom of the page, a summary of the action is displayed. The validity field indicates if the action is complete and can be verified. If the action is valid and the conditions are valid, the rule is valid. If any part of the rule is incomplete or invalid, the rule is invalid.
- You can continue to add actions or click Done to return to the artifact type page.
To create "make required" actions for an action-based dependency rule
- Begin a new rule, as described in Starting a rule definition.
- Create a new entry condition, as described in To create entry conditions for a new action-based rule.
A
summary of the dependency rule is displayed.
At the bottom of the page, an Actions section is displayed.
- To add an action to this rule, click Add New.
- In the Add Conditional Action page, select Make Required and click Continue.
The Add Conditional Action, Required Attributes page is displayed.
- At the bottom of the page, in the Target Attribute section, select the attribute or attributes that the user must set if the entry condition is met.
Note that you can select multiple attributes. Target attributes may be input attributes, user attributes, or both.
- Click Done.
The complete rule is displayed.
- Click Done.
The artifact type page is displayed. At the bottom of the page, a summary of the rule that you just created is displayed. If all parts of the rule are complete and valid, the rule is valid. If any part of the rule is invalid, the rule is invalid.
- You can continue to add actions or click Done to return to the artifact type page.
When you create an action-based dependency rule, you associate a Target Attribute to the value of a Conditional Attribute. Once this Target Attribute is associated, it is locked only for that rule. This means that when you create another dependency rule, you can use the same Target Attribute again, but only if the Conditional Attribute is the same and has a different Conditional Attribute value. For example, you can create the two rules given in the table:
| Type / Name |
Rule 1 |
Rule 2 |
| Conditional Attribute |
Component |
Component |
| Conditional Attribute Value |
Component 1 |
Component 2 |
| Target Attribute |
Assigned To |
Assigned To |
| Target Value |
Alice |
Tom |
Finding an action-based rule
The steps for finding a rule depend on your project role.
To find the rule that you want to edit (project owner)
- Click the Projects tab and click the link for a project.
- Select the Project Tracker link in the left navigation pane.
- Click Manage Artifact Types in the left navigation pane.
- Click the link for the artifact type that contains the rule that you want to find.
- At the bottom of the page, in the Attribute Dependency Rules section, click the link for the rule that you want to edit.
A summary page for the rule is displayed.
To find the rule that you want to edit (other administrator)
- If you are an administrator with permission to access the Administration tab,
Click the Administration tab.
- In the left navigation pane, click the Artifact Types link in Project Tracker set of links.
- Click the link for the artifact type that contains the rule that you want to find.
- At the bottom of the page, in the Attribute Dependency Rules section, click the link for the rule that you want to edit.
A summary page for the rule is displayed.
Editing and deleting an action-based rule
You can modify and remove action-based rules.
To edit the rule
- Find the rule, as described in Finding an action-based rule.
- From the summary page for the rule, you can edit the Name and Description.
- To edit the entry conditions, click the Edit Condition button.
- To edit an action, click the Summary link for the action.
- Click Done.
To delete the rule
- Find the rule, as described in Finding an action-based rule.
- In the Select column, click the check box for the rule.
- Click Delete Selected.
- Click Done.
Creating rules based on an attribute option filter
The following paragraphs describe how to create a rule that is based on an attribute option filter.
To start a rule based on an attribute option filter
- Begin a new rule, as described in Starting a rule definition.
- In the Create New Project Rule page, select Attribute Option Filter.
- Click Continue.
The Add Option Filter page is displayed.
- Provide a Name and a Description for this rule.
- Select the source and target attributes.
If there are no attributes displayed in the Source Attribute drop-down list, you need to add list-type attributes to the artifact. You can use a source attribute in multiple option filters. However, an attribute can only be used once as a target. If an attribute is missing from the Target Attribute drop-down list, it may already be in use in a rule.
- Click Save.
A
summary page is displayed, showing the rule components. You can now define associations between the source attribute values and the target attribute values. These are the attribute option filters.
To create attribute option filters
- Create the basic components of the rule, as described in To start a rule based on an attribute option filter.
- From the summary page for the rule, in the Associations section, click Edit Associations.
The Add Associations for the Selected Option page appears. This page displays a list of values for the source attribute.
- In the list of associations, click the radio button for the value for which you want to define an option filter.
- Click Edit Selected.
- In the Create New Associations section of the page, select the target attribute options that you want to display when a user sets the source option to this value.
For example, suppose that you have selected Status as the source attribute, and the source attribute value is New. You could select a target attribute called Resolution, and restrict the values shown for Resolution to be None or Will Not Fix when a user sets the value of Status to New.
- Click Save.
- Repeat steps 3-6 until you have created as many associations as you want.
- When you are finished, click Done.
A summary page is displayed showing the rule components.
- If the rule is complete, click Done.
The main page for the artifact appears. The rule is summarized in the Attribute Dependency Rules section at the bottom of the page.
Note: If all parts of the dependent attribute rule are complete and valid, the rule is valid. If any component of the rule is invalid, the entire rule is invalid.
Editing a rule based on an attribute option filter
You can modify and remove rules that are based on an attribute option filter
To edit the rule
- Find the rule.
- From the list of dependent attributes, click the link for the rule.
A summary page for the rule appears.
- In the summary page, input a new Name and Description and click Save.
- To change the attributes that belong to this rule, click the Edit button in the Attributes section of the page.
- To change which values in the target attribute are associated with a source value, click Edit Associations in the Associations section of the page.
- When you are finished, click Done.
To delete the rule
- Deleting a rule that is based on an attribute option filter is the same as deleting an action-based rule. Follow the steps in Editing and deleting an action-based rule.