Creating custom attributes to support work item queries

To query work items based on the state of code review or reviewers, you must create two custom attributes. The custom attributes are created solely for supporting work item queries and therefore must be hidden. This is an optional setting that you can configure if your project area members require work item query support.

Before you begin

The permissions that are assigned for these custom attributes are based on the role of the user who works in code review. Based on your process configuration, some roles might not have permission to update the custom attributes. To avoid this restriction, you must review your process configuration or allow the role ‘everyone’ at the project area level to modify these two attributes. However, users are not allowed to modify the attributes directly as they are hidden attributes.

Procedure

  1. To create the list of statuses by using the Enumeration tab for the Code Review Status attribute:
    1. On the Application Administration page of the web client, click the Project Areas tab.
    2. On the Active Project Areas page, click the project area that you want to configure and then, click Work Items.
    3. In the Work Items tab, click Enumerations and then, click Add.
      enum_add
    4. In the Add Enumeration dialog box, enter the required fields, and then, click OK.
      • Name: Code Review Status Enum
      • ID: codereview.reviewstatusEnum
    5. In the Literals section, click Add.
      literal_add
    6. In the Add Literal dialog box, add the following code review statuses one by one. If you want the code review text in English, then the names must match exactly as follows:
      • Pending
      • Submitted
      • In Review
      • In Revision
      • Approved
      • Closed
      • Unknown
    7. In the Details section of the Enumeration tab, select the value for the Default Literal as Submitted and then, click Save.enum_default_literal
    8. Optional: If you want to use other languages for code review statuses, you must change the IDs of the literals by using the Eclipse client.
      1. Right-click the project area in an editor and click Open. Select the Process Configuration Source tab.
      2. Search for the ‘codereview.reviewStatusEnum” enumeration and change the ID for each literal to the following values:
        • com.ibm.team.filesystem.codeReviewState.pending
        • com.ibm.team.filesystem.codeReviewState.submitted
        • com.ibm.team.filesystem.codeReviewState.inReview
        • com.ibm.team.filesystem.codeReviewState.inRevision
        • com.ibm.team.filesystem.codeReviewState.approved
        • com.ibm.team.filesystem.codeReviewState.closed
        • com.ibm.team.filesystem.codeReviewState.unknown

      Example literal definition when French is used (for In Review):

      <literal
        		  icon =””
        		  id= “com.ibm.team.filesystem.codeReviewState.inReview”
         		  name=”En Revue”/>
      
  2. On the Application Administration page of the web client, click the Project Areas tab.
  3. On the Active Project Areas page, click the project area that you want to configure and then, click Work Items.
  4. In the Work Items tab, click Types and Attributes.
  5. In the Types and Attributes subtab, on the Attributes section heading, click Add.
    The Add Attribute dialog box is displayed.

    add_attribute

  6. Create the custom attribute Code Review Status. Enter the details as follows and click OK:
    • Name: Code Review Status
    • ID: codereview.reviewStatus (IMPORTANT: you must use this exact ID)
    • Type: Enumeration list that you created in step 1-f to add enumeration for Code Review Status attribute Ex: “Code Review Status Enum (Enumeration List)”
  7. In the Types and Attributes subtab, on the Attributes section heading, click Add.
  8. Create the custom attribute Code Reviewers. Enter the details as follows and click OK:
    • Name: Code Reviewers
    • ID: codereview.reviewers (IMPORTANT: you must use this exact ID)
    • Type: Contributor list (Default list already present in work items)
    Note: If code review presentation tab is added, ensure that the permissions configured at both places are aligned to each other. Any misconfiguration can lead to discrepancies.
  9. Click Save to save the newly added custom attributes to the work item.
    Note: Ensure that these custom attributes are added to all work item types that follow the code review process.
  10. Optional: To reuse the custom attributes for other work item types:
    1. In the Add Attribute dialog box (refer step 5), select Reuse Existing Attribute.
    2. Select the required attribute that you created earlier. Only one attribute can be added at a time.