A. The Schema Editor (Administrators Only) : Change Packages Tab

Change Packages Tab
AccuRev Enterprise supports an enhanced integration between AccuRev and AccuWork: any AccuWork issue record can act as a change package, keeping track of which versions were created to fix the bug (or implement the new feature) described in that issue record. For a thorough discussion, see the topic Change-Package-Level Integration between AccuRev and AccuWork on page 400.
The Change Packages subtab configures the way in which change packages are reported and updated, on a depot-by-depot basis.
Change Packages Subtab Layout
The Change Packages subtab specifies the change-package configuration for the current depot. It is organized as follows:
In the Change Package Results section, you specify the format of the change-package table displayed by a Show Issues or Show Diff By Issues command. This set of fields is also used to identify issue records in the Issue Dependencies tab.
In the Change Package Triggers section, you enable the change-package-level integration between AccuRev and AccuWork, by specifying one or more AccuWork queries, one of which will be invoked during execution of the Promote command. (The user chooses one or more of the issues records selected by the query; AccuRev adds the promoted versions to those issue record(s)' change packages.) In this section, you also specify the format of the table that displays the results of the Promote-time query to the user.
In addition, the Issue Owner Field drop-down list displayed at the bottom of the tab can be set to any AccuWork field that contains user/group data. The field specified here displays on the Send to Issue dialog, and allows the user to choose an issue belonging to another user or group.
Working in the Change Package Results Section
Click the Setup Columns button to bring up a dialog box in which you select a set of issue fields, to be displayed as table columns. See Set Up Columns on page 321. You can also specify the order of the fields.
After closing this dialog box, you can adjust column widths and change the order of columns. (See Working with Tables on page 14.)
Working in the Change Package Triggers Section
This section contains a set of condition/query pairs, one of which will be executed at Promote-time. If the first condition is satisfied, the first query will be executed; otherwise the second condition will be evaluated, and if it's satisfied, the second query will be executed; and so on. No error occurs if no condition is satisfied; the Promote command proceeds without triggering any change-package-level activity.
Note that there is no checkbox or button to enable the change-package-level integration. Rather, the existence of one or more condition/query pairs in this section implicitly enables the integration.
Composing a Condition
Each clause of a condition performs a test on the Promote destination stream (indicated by the keyword PROMOTE_DEST_STREAM). For example, this condition is satisfied if the user is promoting to either of the streams maint or forms:
The mechanics of composing the condition are similar to that of composing an AccuWork query (see Working in the Query Editor on page 317).
Composing a Query
Corresponding to each Promote-destination condition is any AccuWork query, to selects a set of issue records. For the mechanics of composing the query, see Working in the Query Editor on page 317.
Formatting the Table Displayed by the Change Package Trigger
To specify the format of the table displayed by the Promote command when it invokes the change-package-level integration between AccuRev and AccuWork, click the Setup Columns button to bring up a dialog box. Use this dialog box to select fields to appear as columns, the order of the columns (fields), and the sort order of the rows (records). After closing this dialog box, you can adjust the column widths and rearrange the columns.
Change-Package-Level Integration between AccuRev and AccuWork
AccuRev provides a change package feature that integrates AccuRev's configuration management functionality with AccuWork’s issue management functionality.
When a Promote command is executed a user's workspace (but not in a higher-level dynamic stream), the change-package-level integration records all the promoted versions on the Changes subtab of a user-specified AccuWork issue record.
Enabling the Integration
The change-package-level integration is enabled on a depot-by-depot basis. Open the Schema Editor for a particular depot, and go to the Change Packages subtab. Filling in the lower section, "Change Package Triggers", enables the integration for that particular depot.
The Change Package Triggers section is structured as a set of condition/query pairs. One of the queries will be selected for execution at Promote-time. If the first condition is satisfied, the first query will be executed; otherwise the second condition will be evaluated, and if it's satisfied, the second query will be executed; and so on. 
Each clause of a condition performs a test on the Promote destination stream. For example, this condition is satisfied if the user is promoting to either of the streams maint or forms:
The condition must test the destination stream (PROMOTE_DEST_STREAM) of a Promote command. The query corresponding to each condition can be any AccuWork query, which selects a set of issue records.
The Change Package Triggers section also specifies the format of each query's results table -- the fields to appear as columns, the column widths, the order of the columns (fields), and the sort order of the rows (records).
In addition, the Issue Owner Field drop-down list displayed at the bottom of the Change Packages tab can be set to any AccuWork field that contains user/group data. The field specified here displays on the Send to Issue dialog.
Triggering the Integration
Once the integration is enabled for a depot, it is triggered whenever a user performs a Promote command in a workspace associated with that depot:
1.
2.
Note: If you have enabled the use of third-party issue tracking system (ITS) keys in the AccuWork schema, the Select Issue (Change Package) dialog displays additional controls that let you specify whether you want to use AccuWork issue numbers or third-party keys when selecting issues to promote against. See the section called, “Using Third-Party Keys in the AccuRev GUI,” in Appendix A (The Schema Editor (Administrators Only)) of the AccuRev Online Help Guide for more information.
3.
Promoting to Issues Other than Those Shown -- The dialog has a New Issue button, which enables the user to create a new issue record "on the fly". If the user hovers over the icon to the right of the New Issue button, it will display a tooltip containing the Change Package Triggers query. This makes it easier to create an issue that will be selected by the query, and thus available to promote against.
There may also be a user field to the right of the Issue # field that can be used to show issues belonging to another user.
Typing an Identifier when using a Third-Party ITS -- If a field other than the default issueNum is specified as the 3pty ITS Key (on the Schema Editor’s Schema subtab), specifying issue records by typing their identifiers can lead to errors: if multiple issue records have the same identifier, AccuRev automatically adds the promoted version(s) to just one of those records — perhaps not the one you intended.
4.
5.
What happens if the user specifies no issue record or a non-existent issue record, such as 99999 or 0?
If the user enters "0" (or equivalently, makes a blank or non-numeric entry), AccuRev checks whether issue record #0 is among the issues selected by the query executed Step 1. (Note: the query can select issue record #0, even though it doesn't exist -- for example with this clause: issueNum equal to 0.)
If the query does select issue record #0, the user's command completes but no information is recorded in the issue. This provides a way for the user to bypass the integration when performing the Promote command.
If the query does not select issue record #0, the user's command is cancelled, and no information is recorded in the issue.
Configuring and Using Third-Party ITS Keys
If you use AccuRev with a third-party issue tracking system (whether through an integration, or just in parallel), you might find it convenient to use the third-party issue numbers (“keys”) along with or instead of AccuWork issue numbers.
To do this, you need to:
Specify a -3 switch with CLI commands that make use of third-party tracking numbers (for example, promote -3 -I <3rd_party_ITS_key> <element_name>).
Modifying the schema
To make use of third-party ITS keys, you must first modify the AccuRev schema. You can do this by either manually editing the schema.xml file, or by using the Schema Editor in the AccuRev GUI (see the “Schema Editor” section of the AccuRev On-Line Help Guide).
Using the Schema Editor
If you do not wish to edit schema.xml directly, you can use the Schema Editor in the AccuRev GUI. Identify an existing key field that can be used, or define a new one using the Add button. Then assign this key field using the 3pty ITS Key dropdown menu.
Note that some AccuRev schemas (like the schemas delivered with AccuSync) already have a third-party key defined, such as “jirakey”. If this is the third-party ITS key that you need to use, you just need to ensure that it is assigned to the 3pty ITS Key dropdown menu as described above, and that it is positioned on the Issue form as described below.
Next go to the Layout tab and position this field in the Issue form (or confirm that it is already there). To position it, select the entry in the Fields column, and then click where you want it to appear in the left side of the tab (for example, in the Header section).
Save your changes and exit the Schema Editor. Now when you display the AccuWork Issue form, the third-party ITS key field will be displayed.
Editing schema.xml
You can also directly edit the schema XML files (schema.xml and layout.xml). In a text editor, open the schema.xml file for your depot:
<ac_install>/storage/depots/<depot_name>/dispatch/config/schema.xml
First, determine if you need to define a new field to handle the third-party ITS key. Note that all AccuRev schemas have an entry for AccuWork issue numbers. For example:
<field
name="issueNum"
type="internal"
label="Issue"
reportWidth="10"
fid="1">
Do not use this for third-party ITS keys. Define a new one (or determine if you already have one available in your schema) and make sure that it is specified in the lookupField as described below.
Some AccuRev schemas (such as the schemas delivered with AccuSync) already have a third-party key defined, such as:
<field
name="jiraKey"
type="Text"
label="JIRA Key"
reportWidth="10"
width="10"
fid="3">
</field>
If you need to define a new key, do so using the above key as an example, making sure to assign it an unused fid (field ID) number.
After identifying a key field, or defining a new one, modify the fid value of the lookupField entry to reflect the new key field (the lookupField entry is typically found near the top of schema.xml:
<lookupField fid="1"/>
For example, if you were modifying this entry to use the jiraKey field shown above, you would change the fid value to “3”.
If you will be using this convention in new depots that you create in the future, you should also make this change to the master copy of schema.xml in:
<ac_install>/storage/site_slice/dispatch/config
To position this field on the Issue form (or to confirm that its position is already defined), open layout.xml in a text editor. Use the existing entries in the file as a model for defining the third-party ITS key field.
Using Third-Party ITS Keys in the CLI
Once the schema has been configured as described in the previous section, you use third-party ITS keys with a variety of AccuRev CLI input commands by specifying the new “-3” switch in addition to the traditional “-I” switch (for example “-3 -I US23407”). Note that you can also still use AccuWork issue numbers by using the traditional “-I” switch by itself, but you cannot specify both on the same command line.
Here are the AccuRev commands that accept the -3 switch:
Here are some examples of using the promote command with the -3 switch:
Promote a file and associate it with an issue using the third-party issue key:
accurev promote -I <3rd_pty_key> -3 <element_name>
Promote a file and associate it with several issues using third-party issue keys:
accurev promote -I "<3rd_pty_key_1> <3rd_pty_key_2> <3rd_pty_key_3>"
-3 <element_name>
You can also use the third-party keys with the -Fx switch for XML. For example, to promote a file using the -Fx switch and associate it with several issues using third-party issue keys:
accurev promote -Fx -l <xml_filename>
where the XML file has the following format:
<issues third_party=”true”>
<id>
[3rd_pty_key_1]</id>
<id>[3rd_pty_key_2]</id>
<id>[3rd_pty_key_3]</id>
</issues>
Commands That Return Third Party Issue Numbers
These commands return third-party key information in XML output (specified with the -fx switch):
cpkdepend also returns third-party key information in non-XML format. If you specify -3 to query the dependency, then the values in non-fx will be displayed using third-party values. If specify standard issue numbers, they will be displayed in standard format. If you specify -3 without -fx and an issue does not have a third-party value, an asterick ('*') appears before the issue number.
In the examples below, the third-party values are displayed in bold. "thirdPartyName" is the field name (not the label name) defined in the Schema Editor.
hist example output
<version
path="\.\file.cpp"
eid="3"
virtual="4/2"
real="5/2"
virtualNamedVersion="s25263_proj1_dev/2"
realNamedVersion="ws25263_testuser1/2"
elem_type="text"
dir="no">
<issueNum
thirdPartyName="jiraKey"
thirdPartyValue="J1002">2</issueNum>
</version>
cpkdepend example output
<acResponse>
<issueDependencies>
<issueDependency>
<issues>
<issue
number="2"
thirdPartyName="jiraKey"
thirdPartyValue="J1002"
incomplete="false"/>
</issues>
<dependencies>
<issue
number="1"
thirdPartyName="jiraKey"
thirdPartyValue="J1001"/>
</dependencies>
</issueDependency>
</issueDependencies>
</acResponse>
Using Third-Party Keys in the AccuRev GUI
Once you have enabled the use of third-party issue tracking system (ITS) keys in the AccuWork schema, the Select Issue (Change Package) dialog and the Look Up Issue dialog display additional controls that let you indicate whether you want to use AccuWork issue numbers or third-party ITS keys when specifying issues.
For example, when you bring up the Look Up Issue dialog, if third-party ITS keys are enabled AccuRev displays radio buttons that let you indicate that you want AccuRev to use the third-party key rather than the AccuWork issue number when looking up the issue.
The radio button for the ITS is labeled with whatever text is specified in the Schema Editor for the "Label" field (see Using the Schema Editor on page 404).

Borland