Update Work Item

API Type

REST

HTTP Method

POST

Description

Updates a manual work item or automatic work item.

URL Format (On Premises)

https://[domain]:[port]/AgilePointServer/Workflow/UpdateWorkItem/[workItemID]

URL Format (AgilePoint for Azure)

https://[domain]:[port]/AgilePointService/Workflow/UpdateWorkItem/[workItemID]

Request 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.

Request Body Properties

Name Description

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.

JavaScript Code Example

$("#btnUpdateWorkItem").click(function () {
  
  var JSONObject = { attributes: [{ Name: "NAME", Value: "nishant" }]};
  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Workflow/
                UpdateWorkItem/3D1F3E6003E4487ABA8E2ADB22A85CC2",
    data: JSON.stringify(JSONObject)
  });
  
});

Java Code Example

public String UpdateWorkItem(String workItemID, String[] Name,
  String[] Value) {

  String URI = "http://mydomain:9011/AgilePointServer/Workflow/UpdateWorkItem/"
                       + workItemID;

  HTTPOperations ops = new HTTPOperations(domain, this.userName,
                       password, appID, locale);

  JSONArray postArray = new JSONArray();

  try {
    for (int i = 0; i < Name.length; i++) {
      JSONObject nameValuePair = new JSONObject();
      nameValuePair.put("Name", Name[i]);
      nameValuePair.put("Value", Value[i]);

      postArray.put(nameValuePair);
    }

    JSONObject postData = new JSONObject();
    postData.put("attributes", postArray);
    return ops.POSTMethod(URI, postData.toString());
  } catch (JSONException e1) {
    e1.printStackTrace();
  }
  return "";
}

Output

None.

JSON Response Body Example

The response body is empty.

Supported Versions

AgilePoint BPMS v5.0 R2 and higher