Bulk Query Update Items operation
The Bulk Query Update Items operation updates fields in the BMC Remedy Action Request (AR) System data store with a new value for each item in the XML document. This operation updates the items in a transaction-based manner. Even if one entry contains an incorrect/invalid value, the entire operation fails.
The following table describes the input elements for the Bulk Query Update Items operation.
Input elements for the Bulk Query Update Items operation
Input element | Description | Required |
---|---|---|
<adapter-name> | Specifies the name of the adapter in the adapter configuration that is used to execute the operation | No |
<items> | Specifies the XML document containing the elements required to update all the records matching the query for the specified fields in the BMC Remedy AR System schema | Yes |
The following figure shows a sample adapter request for the Bulk Query Update Items operation.
Sample adapter request XML for the Bulk Query Update Items operation
<request-action>bulk-query-update</request-action>
<request-data>
<remedy-action>
<items>
<item>
<field-id>1000000182</field-id>
<schema>CHG:ChangeInterface</schema>
<id>CRQ000000001331</id>
<fields>
<field name="Description"><![CDATA[User123456]]]></field>
</fields>
</item>
<item>
<field-id>1000000182</field-id>
<schema>CHG:ChangeInterface</schema>
<id>CRQ000000001332</id>
<fields>
<field name="Description"><![CDATA[User123456]]]></field>
</fields>
</item>
</items>
</remedy-action>
</request-data>
</adapter-request>
The following figure shows the adapter response for the Bulk Query Update Items operation.
Adapter response XML for the Bulk Query Update Items operation
<execution-duration>227100</execution-duration>
<status>success</status>
<messageBase64></messageBase64>
<data>
<bulk-query-update-action-result>
<entries>
<entry>
<schema>BulkUpdates</schema>
<query>'536870913'="2"</query>
<status>success</status>
<updated-entry-count>1</updated-entry-count>
</entry>
<entry>
<schema>BulkUpdates</schema>
<query>'Entry Text'="1"</query>
<status>success</status>
<updated-entry-count>11</updated-entry-count>
</entry>
</entries>
</bulk-query-update-action-result>
</data>
</adapter-response>
The following table describes the output element for the Bulk Query Update Items operation.
Output element for the Bulk Query Update Items operation
Output | Description |
---|---|
<bulk-query-update-action-result> | Contains <entries> based on whether the operation is successfull or failed |
<entries> | Contains individual <entry> for each updated item |
<entry> | Contains the result for each <item> specified in the adapter request |
<updated-entry-count> | Contains the count of updated entries as specified in the adapter request. If any incorrect/invalid values for any one or more entries are specified in the request, the operation fails and the value for <updated-entry-count> appears as 0. Example, 2. |
<status> | Contains the status of the request. If the value is <success>, all entries specified in the adapter request are updated successfully. If any incorrect/invalid values for any one or more entries are specified in the request, The reason for the failure is described in the <status-reason> element. |
<status-reason> | Contains the reason due to which the adapter request failed. |
<schema> | Contains the name of the schema that is not updated due to the adapter request failure. |
<query> | Contains the query as specified in the <items> XML |
The following figure shows the sample adapter response if the adapter request fails.
Adapter response XML if the request fails
<execution-duration>42587</execution-duration>
<status>success</status>
<messageBase64></messageBase64>
<data>
<bulk-query-update-action-result>
<entries>
<entry>
<schema>TestBulkUpdates</schema>
<query>'536870913'="XYZ"</query>
<status>error</status>
<status-reason>Query ['536870913'="XYZ" ] returned 0 entry count</status-reason>
<updated-entry-count>0</updated-entry-count>
</entry>
<entry>
<schema>TestBulkUpdates</schema>
<query>'Entry Text'="1"</query>
<status>success</status>
<updated-entry-count>11</updated-entry-count>
</entry>
</entries>
</bulk-query-update-action-result>
</data>
</adapter-response>