Record Query for a Specific Work Item Context

To query records for a specific work item context, specify an additional WORKITEMREFERENCE input parameter.

This is shown in the following example:

<DataService version="2.0">
<Identity>
  <DirectoryPath>
   <Directory type="Enterprise">${#Project#Enterprise}</Directory>
   <Directory type="User">${#Project#User}</Directory>
  </DirectoryPath>
  <Authentication>${#Project#password}</Authentication>
</Identity>
<Transaction>
<Context>
 <Variable name="WORKITEMREFERENCE" type="string">37130</Variable>
</Context>
<Command type="Query">
<StartCount>1</StartCount>
<MaxCount>10</MaxCount>
<MasterCatalogRecord etype="Entity">
<ExternalKeys>
  <Key name="MASTERCATALOGNAME"    type="string">${#Project#MASTERCATALOGNAME}</Key>
  <Key name="PRODUCTID" operator='eq'>REC1</Key>
  <Key name="PRODUCTIDEXT" operator='eq'>REC1</Key>
</ExternalKeys>
</MasterCatalogRecord>
</Command>
</Transaction>
</DataService>

The “Query records for workitem” does not return related records of the given record. For example, if there is a hierarchy a-contains-b-contains-c and you have queried for record “a”, only the matching record for the given filter criteria is returned in the response XML.