AccuWork™ Command-Line Interface : Modifying an Existing Issue Record

Modifying an Existing Issue Record
Use the following procedure to modify an existing issue record:
1.
Create a query to select the desired issue record, as described in Selecting Issue Records with a Query on page 274. For example, to select issue record #472 from the Problems depot, create this XML document:
<queryIssue issueDB="Problems">
1 == "472"
</queryIssue>
2.
accurev xml -l myquery.xml > issue472.xml
3.
Change the top-level XML <issues> start-tag to <modifyIssue>. Include the issueDB attribute in the start-tag:
<modifyIssue issueDB = "Problems">
At the end of the file, change the </issues> end-tag to </modifyIssue>.
Remove the entire <transNum> element.
Important! Starting in Version 4.6, the XML output file from Step 2 uses UTF-8 encoding, but the input file in Step 4 is interpreted as US-ASCII. Any non-ASCII characters in the file must be coded in decimal entity notation — for example, &#160; .
4.
accurev xml -l issue472.xml
When you submit the <modifyIssue> data structure to the AccuWork CLI, it modifies the specified issue record. As when you create a new issue record with the AccuWork CLI, field validations are not applied.
To verify the new record’s contents, submit the original query again:
accurev xml -l myquery.xml
Using ‘modifyIssue’ to Create New Issue Records
Instead of using a <modifyIssue> document to change an existing issue record, you can use it to create a new issue record. This is useful for copying issue records from one depot to another. For example, you might use a <queryIssue> document, as described earlier, to retrieve the contents of an issue record from depot Problems, in the form of an <issues> document. As described in Step 3 above, when you change the <issues> tag to a <modifyIssue> tag, specify a different depot:
<modifyIssue issueDB = "Problems_Public">
In this example, the issue record will effectively be copied from the Problems depot to the Problems_Public depot. Make sure the target depot exists and has the same schema as the source depot.
The <modifyIssue> technique is also useful for making copies of the issue records that act as change packages, and for replicating issue records between different AccuRev sites.
Note that a new issue record created with <newIssue> always gets assigned the next available issue number; by contrast, a new issue record created with <modifyIssue> gets the issue number specified by the <issueNum fid="1"> subelement:
<issueNum
fid="1">4197</issueNum>
An issue record with this number must not already exist in the target depot, but there is no other restriction. It’s perfectly OK for most issue numbers to be unallocated.

AccuRev, Inc.
Phone: 781-861-8700
Fax: 781-861-8704
support@accurev.com