Update Work Item

API Type

Web Services

Description

Updates a manual work item or automatic work item.

Syntax

public virtual void UpdateWorkItem(string workItemID, NameValue[] attributes)

Parameters

Name Description

workItemID

Definition:
An ID that represents a work item (task).
Type
string
Allowed Values:
A valid, unique 32-byte work item (task) ID.

attributes

Definition:
A NameValue array that contains the attributes that needs to be updated in the work item.
Type
NameValue
Allowed Values:

For a manual work item, the following attributes can be updated:

  • NAME
  • ORIGINAL_USER_ID
  • CLIENT_DATA, POOL_ID
  • POOL_INFO
  • STATUS
  • USER_ID
  • PRIORITY
  • DUE_DATE

For an automatic work item, the following attributes can be updated:

  • DUE_DATE
  • STATUS - if the value is Canceled, Completed, Overdue, Running, or Waiting.

Output

None.

Example

IWFWorkflowService svc = GetWorkflowService();
string workItemID = …// work item ID of manual work item or automatic work item.

try
	{
    NameValue[] attributes = NameValue.Array( 
    "NAME", "[New Name]",
    "DUE_DATE", [DateTime]); // for example, DateTime.Now.AddDays(3.0)
    svc.UpdateWorkItem(workItemID, attributes);
	}

catch (Exception ex)
	{
    Console.WriteLine("Failed! " + ShUtil.GetSoapMessage(ex));
	}

Supported Versions

3.2.0.4and higher