Create Carbon Copy Work Item (Task)

API Type

REST

HTTP Method

POST

Description

Creates a Carbon copy task for a manager that does not have to be completed in order for a process instance to advance to the next activity.

Good to Know

  • To call this method, the API account user must have the access right, Create a Task.

URL Format (OnPremises, PrivateCloud)

https://[domain]:[port]/AgilePointServer/Workflow/CreatePseudoWorkItem

URL Format (OnDemand)

https://[domain]:[port]/AgilePointService/Workflow/CreatePseudoWorkItem

Request Parameters

Name Description
None Not Applicable

Request Body Properties

Name Description

bReserved

Function:
Reserved for future use.
Type
bool
Accepted Values:
A null value

BusinessTime

Function:
Determines whether the system calculates the duration using your business time calendar.
Type
bool
Accepted Values:
  • True - The system calculates duration using business time.
  • False - The calculates the duration based on real time.

ClientData

Function:
Specifies the client data, which identifies a client for AgilePoint Server.
Type
string
Accepted Values:
A string that contains the client data.

If this value is null, the system will keep existing client data. Otherwise the relevant data is overwritten.

Length

Function:
Specifies the length of time duration.
Type
string
Accepted Values:
A valid time duration length.

SourceWorkItemID

Function:
An ID that represents the original, or source, work item.
Type
string
Accepted Values:
A valid, unique 32-character ID.

Unit

Function:
Specifies the unit.
Type
string
Accepted Values:
A valid unit.

UserID

Function:
Specifies the user ID.
Type
string
Accepted Values:
A valid user ID.

WorkToPerform

Function:
Represents the task that performed by the participants of the activity.
Type
string
Accepted Values:
A valid work to perform name.

These properties are based on the class CreatePseudoWorkItemHelper

JavaScript Code Example

$("#btnCreatePseudoWorkItem").click(function () {

  var JSONObject = { 
        SourceWorkItemID: "2AA1E203047B41F29E3E29F62D00903B",
        WorkToPerform: "Test1234", 
        UserID: "mydomain\\brian.lucas",
        Length: "2",
        Unit: "DAY",
        BusinessTime:true,
        bReserved: true,
        ClientData: null
  };
  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Workflow/CreatePseudoWorkItem",
    data: JSON.stringify(JSONObject)
  });
  }
});

Java Code Example

public String CreatePseudoWorkItem() {

  String URI = "https://mydomain:9011/AgilePointServer/Workflow/CreatePseudoWorkItem";

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

  JSONObject postData = new JSONObject();
  
    postData.put("SourceWorkItemID", "2AA1E203047B41F29E3E29F62D00903B");
    postData.put("WorkToPerform", "New WorkItem");
    postData.put("UserID", "mydomain\\susan.miller");
    postData.put("Length", "2");
    postData.put("Unit", "DAY");
    postData.put("BusinessTime", "true");
    postData.put("bDependent", "true");
    postData.put("ClientData", "");
    return ops.POSTMethod(URI, postData.toString());
  return "";
}

C# Code Example

public string btnCreatePseudoWorkItem()
  {
    string URL = "https://mydomain:9011/AgilePointServer/Workflow/CreatePseudoWorkItem";

    string jsonRequestData = "{
      \"SourceWorkItemID\":\"2AA1E203047B41F29E3E29F62D00903B\",
      \"WorkToPerform\":\"Test1234\",
      \"UserID\":\"ap2\\administrator\",
      \"Length\":\"2\",
      \"Unit\":\"DAY\",
      \"BusinessTime\":\"true\",
      \"bReserved\":\"true\",
      \"ClientData\":\"" + null + "\"}";

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

    return ops.POSTMethod(URL, jsonRequestData);
  }

cURL Code Example

Note: The authorization code is an example. You must generate your own authorization code in base64 encoded format with the syntax Domain\Username:Password.
curl --header "Content-Type: application/json" 
                         --header "Authorization:Basic QVAtNDI0XEFkbWluOnBhc3M=" 
                         --request POST 
                         --data {\"SourceWorkItemID\":\"827228D244B4F4D91177678FFB6AD312\",
                         \"WorkToPerform\":\"Test1234\",
                         \"UserID\":\"ap2\\administrator\",
                         \"Length\":\"2\",
                         \"Unit\":\"DAY\",
                         \"BusinessTime\":\"true\",
                         \"bReserved\":\"true\",
                         \"ClientData\":\"null\"}
                         https://mydomain:9011/AgilePointServer/Workflow/CreatePseudoWorkItem

Output

WFEvent object that provides the status of the transaction. The possible statuses are:

  • Sent - Indicates event has been sent to engine for processing.
  • Failed - Indicates event failed to process.
  • Processed - Indicates event has been processed successfully.
  • Canceled - Indicates event was canceled.
  • Deferred - Indicates event does not need to be sent immediately.

JSON Response Body Example

{
  "ActivityInstID": "0DB05C1A1BAB445895CCF46E096AECDD",
  "AutoStart": true,
  "CustomAttributes": null,
  "Diagnostic": true,
  "EndDate": "\/Date(928149600000+0000)\/",
  "Entries": 1,
  "Error": null,
  "EventID": "572215CBEA884B7890259879C21FAC42",
  "EventName": "CreateWorkItem",
  "HighPriority": true,
  "ParamsXml": "<?xml version=\"1.0\" encoding=\"utf-8\"?>
                <WFEvent>
                  <param name=\"ExpectedTime\" 
                            value=\"2 Day(s)(business time)\" \/>
                  <param name=\"workPerformer\" value=\"Revise\" \/>
                  <param name=\"SourceWorkItemID\" 
                            value=\"2AA1E203047B41F29E3E29F62D00903B\" \/>
                  <param name=\"ProcInstID\" 
                            value=\"B7F0ACFA610349B4BF10A4DAB8E93458\" \/>
                  <param name=\"UserID\" value=\"mydomain\\brian.lucas\" \/>
                  <param name=\"ActivityInstID\" 
                            value=\"0DB05C1A1BAB445895CCF46E096AECDD\" \/>
                  <param name=\"waitWorkPerformed\" value=\"True\" \/>
                  <param name=\"HighPriority\" value=\"True\" \/>
                  <param name=\"Carbon\" value=\"False\" \/>
                  <param name=\"WorkItemID\" 
                            value=\"CE4265BC8CA944F885446962D0463974\" \/>
                <\/WFEvent>",
  "ParentProcInstID": "",
  "ProcDefID": "",
  "ProcInstID": "B7F0ACFA610349B4BF10A4DAB8E93458",
  "ProcInstName": "",
  "Sender": "mydomain\\brian.lucas",
  "SentDate": "\/Date(1394148475011+0000)\/",
  "SourceWorkItemID": "2AA1E203047B41F29E3E29F62D00903B",
  "Status": "Sent",
  "UserID": "mydomain\\brian.lucas",
  "WorkItemID": "CE4265BC8CA944F885446962D0463974",
  "WorkObjectID": "",
  "WorkObjectInfo": ""
}

Supported Versions

AgilePoint v5.0 R2 and higher

Code Examples in the AgilePoint NX Documentation

The AgilePoint NX Product Documentation is intended as a basic reference to help you understand how to complete basic coding tasks, such as make API or JavaScript method calls. Code examples that show specific use cases, the solutions to specific business problems, or detailed implementation scenarios are outside the scope of the AgilePoint NX Product Documentation. For specific and/or advanced types of examples that may better meet your requirements, AgilePoint provides several resources:

  • AgilePoint Community Forums - A free, AgilePoint-moderated, crowd-sourcing user forum where you can ask questions about specific techniques, the solutions to use cases, workarounds, or other topics that may not be covered in the Product Documentation.
  • Professional Services - If you can not find the information you need for your specific business problem, mentoring is available through AgilePoint Professional Services.
  • Personalized Training - AgilePoint can provide personalized training for your organization. To request personalized training, contact AgilePoint Sales.