Task/Items/UpdateTasks

Updates a multiple task items in batch with the data posted.

Only actions which have been configured to support batch processing can be updated via the Task service.  Use the Worklist service to action items that do not support batch processing.

URI

{Service Root URI}/Task/Items/UpdateTasks
https://api.denallix.com:443/K2Services/SyncREST.svc/Task/Items/UpdateTasks

Method

POST

This method cannot be called via URI construction in the address bar of standard browsers.  Tooling such as Fiddler or .NET code may be required to execute the POST.

Only XML requests are allowed JSON requests will result in a 202 Status code and the task will NOT be updated.

Request Headers

Ensure that the request has at least these headers set.

Authorization: Basic {encrypted token goes here}
Content-type: application/xml

Request Body

The request body contains an UpdateTaskCollection of the multiple UpdateTask items represented as XML.  The Task item XML returned from Task GET methods can be used as a starting point for the XML input of this POST method.  Any invalid elements or attributes will be ignored.

The UpdateTaskCollection XML consists of the following.

Namespaces

The UpdateTaskCollection XML requires namespaces to be defined.

Elements and Attributes

Request Body Example

This POST will attempt to update two tasks.  The first task (ID=1000) will perform the Rework action.  The second task (ID=1001) will redirect to the DENALLIX\Joe user.

<?xml version=”1.0” encoding="utf-8"?>
<t:UpdateTaskCollection xmlns:t="http://schemas.k2.com/task/d1" xmlns:p="http://schemas.k2.com/process/d1">
 <t:UpdateTask ID="1000" Action="a:Rework">
  <t:Task SerialNumber="1_34" >
   <p:ProcessDataField Name="MyProcessDataField">Some process data value</p:ProcessDataField>
   <p:ProcessXmlField Name="MyProcXmlField">&lt;XmlDocument&gt;Some Process XML document&lt;/XmlDocument&gt;</p:ProcessXmlField>
   <p:ActivityDataField Name="MyActDataField">Some activity data value</p:ActivityDataField>
   <p:ActivityXmlField Name="MyActXmlField">&lt;XmlDocument&gt;Some Activity XML document&lt;/XmlDocument&gt;</p:ActivityXmlField>
  </t:Task>
 </t:UpdateTask>
 <t:UpdateTask ID="1001" Action="r:DENALLIX\Joe">
  <t:Task SerialNumber="2_34" >
   <p:ProcessDataField Name="MyProcessDataField">Some process data value</p:ProcessDataField>
   <p:ProcessXmlField Name="MyProcXmlField">&lt;XmlDocument&gt;Some Process XML document&lt;/XmlDocument&gt;</p:ProcessXmlField>
   <p:ActivityDataField Name="MyActDataField">Some activity data value</p:ActivityDataField>
   <p:ActivityXmlField Name="MyActXmlField">&lt;XmlDocument&gt;Some Activity XML document&lt;/XmlDocument&gt;</p:ActivityXmlField>
  </t:Task>
 </t:UpdateTask>
</t:UpdateTaskCollection>

Return Type

MultiOperationResult – a Success/Failure result for each Task item in the batch

Due to the asynchronous nature of the POST, a successful call may not return anything depending on the tooling used to execute the POST.

Return Example

The results of the batch POST show that one task (ID=1000) updated successfully while another task (ID=1001) failed because rights were insufficient.

Type your example code here. It will be automatically colorized when you POST /K2Services/SyncREST.svc/Task/Items/UpdateTasks

<?xml version="1.0" encoding="utf-8"?>
<MultipleOperationResult xmlns="http://schemas.k2.com/framework/d1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <Failure ID="1001" Code="-1">
  <Message>24411 K2:DENALLIX\Bob from 192.168.1.110:49 is not allowed to open the worklist item with SN=2_34</Message>
  <Description>client- failure</Description>
 </Failure>
 <Success ID="1000"/>
</MultipleOperationResult>