For such simple queries, you can adapt the one we used in section Determining the Field-ID / Field-Name Correspondence above. This query finds all issue records whose productType value is Frammis.The output of a query is an XML document whose top-level <issues> element contains zero or more <issue> sub-elements:>>> accurev xml -l query-filename
<issues>
<issue>
... individual field-name elements ...
</issue>
<issue>
... individual field-name elements ...
</issue>
...
</issues>You may notice that in the output of a query, the <issue> subelements do not include the issue records’ change package data. Use the <cpkdescribe> query to retrieve an issue record’s change package data. See Listing the Contents of a Change Package.You can compose and run arbitrarily complex queries. If the query goes just a bit beyond the simplest, you can probably compose it manually. For example, this query finds all issue records whose productType value is Frammis or Widget:With more complex queries, be sure to include the useAltQuery = "false" attribute in the <queryIssue> start-tag.
1. In the AccuRev GUI, enter the command Issues > Queries to enter the Query Editor.
3. Click the Save All Queries button.
4. Place an XML-format dump of all your queries in a text file:This getconfig command retrieves the contents of the configuration file that stores your queries:
5. Use a text editor to extract the XML <queryIssue> element that defines the query. (Don’t extract the entire <query> element, which includes the query’s name and output field definitions.)
6. This code is perfectly good XML, even though it’s not “pretty-printed”. Also note the use of the XML entity reference " which is equivalent to a double-quote character.Each field in an AccuWork issue has a field type: Text, Choose, List, etc. For a field of type User (such as the submittedBy field in the example in section Determining the Field-ID / Field-Name Correspondence above), a query defaults to reporting users by their integer user-IDs, rather than by their usernames (principal-names):In this case, you could use the output of the accurev show users command to determine that user john has user-ID 40. Alternatively, you can modify the query to set the attribute expandUsers in the <queryIssue> start-tag:Setting expandUsers causes the query to report the values of User fields with usernames instead of user-IDs:For a field of type Timestamp (such as the dateSubmitted field in the example in section Determining the Field-ID / Field-Name Correspondence above), a query always reports the timestamp as a large integer, representing the number of seconds since Jan 1, 1970 UTC:>>> perl -e "print scalar localtime(1083606273)"
Mon May 3 13:44:33 2004
Micro Focus |