The simplest kind of query selects one or more issue records by comparing the value of one field with a literal value (a constant) — for example, “is the value of the issueNum field equal to 415?” or “does the shortDescription field contain the string ‘busted’?”.
The output of a query is an XML document whose top-level <issues> element contains zero or more
<issue> sub-elements:
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 on page 270.
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:
But to minimize the chance of getting lost in the syntax of more complex queries, we strongly recommend that you compose the complex query graphically, then “export” the query to a text file:
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: