AccuWork CLI Operations

Prerequisite Operation: Field-ID / Field-Name Correlation

In the AccuWork CLI, you identify a field by its field-ID, not by its field-name. Thus, before doing any real AccuWork CLI work, you must determine the correspondence between field-IDs and field-names for issues in your depot. This information is stored in the schema configuration file on the AccuRev Server host:

<AccuRev-inst-dir>/storage/depots/<depot-name>/dispatch/config/schema.xml

You can retrieve the contents of the schema.xml file from an AccuRev client machine with this command:

accurev getconfig -p <depot-name> -r schema.xml

Extract the name= and fid= text lines from this data, and store them for future reference. You’ll need to refer to this information often as you work with the AccuWork CLI. Let’s call this extracted data the field-ID definitions.

For example, the field-ID definitions for the default schema look like this:

name="issueNum"
fid="1">
name="transNum"
fid="2">
name="status"
fid="3">
name="shortDescription"
fid="4">
name="state"
fid="5">
name="productType"
fid="6">
name="type"
fid="7">
name="severity"
fid="8">
name="priority"
fid="9">
name="submittedBy"
fid="10">
name="dateSubmitted"
fid="11">
name="platform"
fid="12">
...

This data shows that field submittedBy has field-ID 10, field productType has field-ID 6, etc.

Note: All examples in the remainder of this document will use the field-ID/field-name correspondence in the above example.

The contents of these XML elements are the field values for issue record #1. A couple of them, submittedBy and dateSubmitted, have values that might be a bit surprising — numbers instead of strings. We’ll discuss these kinds of values in Selecting Issue Records with a Query.

Back to top

AccuWork CLI Operations

You can perform the following AccuWork operations through the command-line interface.

Before performing any of these operations, be sure you have first determined the correspondence of Field-ID and Field-Name.

  • Query issues in a depot (<queryIssue> document) — Retrieve the contents of all issue records in a particular depot that match a specified query.

  • Create a new issue record (<newIssue> document) — Enter a single new issue record in a particular depot.

  • Modify an existing issue record (<modifyIssue> document) — Change the contents of a single issue record that already exists in a particular depot.

  • Add or modify an entry in an issue record’s change package (<cpkadd> document).

  • Remove an entry from an issue record’s change package (<cpkremove> document).

  • List the entries in an issue record’s change package (<cpkdescribe> document).

  • Display history in terms of change packages (<cpkhist> document) — List transactions and the change packages that they modified.

  • Create or remove a Duplicate relationship between two issue records (<relateIssue> or <unrelateIssue> document).

  • Report issue relationships (<listRelatedIssues> document) — List records that are related, through the Duplicate relationship, to a particular issue record.

  • Compare the change packages in two streams, snapshots, or workspaces (<issuediff> document).

  • Display the issues whose change packages are in a particular stream, snapshot, or workspace (<issuelist> document).

Back to top