REST API - getWorkItemReport

The table summarizes the REST API - getWorkItemReport.

Request

Format
GET <baseurl>/audit/report/workitem/<workitemid>
Path Parameters workitemid: identifies the work item ID whose events you want to audit. Can be obtained from getWorkListItems.
Query parameters
  • requireallattributes=string (optional, default=false). Whether all attributes should be returned. Can be obtained from getAllAttributes or getAttributes . The default is false.
  • requiredattribute=string (optional). Specific attributes that should be returned for each event found. Can be obtained from getAllAttributes or getAttributes.
  • sortorder=string (0-n, optional): What attribute or attributes the results should be sorted on, and in what direction the sort should run. Specify this in the following format:

    attribute 1:ASCENDING|DESCENDING;attribute 2:ASCENDING|DESCENDING; … attribute n:ASCENDING|DESCENDING

  • gettotalcount=string (optional, default=true). Whether to include a count of the total number of events in the list. The count is returned in the totalItems value in the response. You should set getTotalCount to false unless you specifically need the total figure, because setting it to true is expensive in terms of database access time. Note that:
    • If you pass false in this attribute, and there is at least one item in the list, the totalItems value returned in the response is -1. However, if you pass false and there are no work items in the list, the totalItems value in the response is 0 (zero).
    • If you pass true in this attribute but numberOfItems is set to zero, the totalItems value in the response is 0 regardless of how many items are actually in the list. The total count of items is only available when you are fetching one or more items.
  • numberofitems=integer (optional, default=-1). The maximum number of events to return. Specifying -1 returns all events for the process instance.
  • populateattributenames=string (optional). Specify that attribute names be returned in the list of events.
  • startposition=integer (optional, default=-1). The position in the list from which to start the page of results. The list is zero-based. To start at the first item, specify 0.
  • fetchcomments=boolean (optional). Returns all comments for the work item.

Response

JSON Returns a JSON representation of the content of the getWorkItemAuditResponse element.
XML Returns the content of the getWorkItemAuditResponse element (from the EventCollectorReportService schema).

Example

Request
GET <baseurl>/audit/report/workitem/7
Response
{
  "xml-fragment": {
    "endPosition": "1",
    "startPosition": "0",
    "totalItems": "1",
    "entry": {
      "creationTime": "2015-09-25T16:44:43.977Z",
      "componentId": "BRM",
      "messageId": "BRM_WORKITEM_SCHEDULED",
      "severity": "AUDIT",
      "message": "New Work Item Schedule.",
      "priority": "MEDIUM",
      "correlationId": "db1199e2-fc06-4ce3-ae14-966e3ea6e4fa",
      "contextId": "db1199e2-fc06-4ce3-ae14-966e3ea6e4fa",
      "messageCategory": "WORK_ITEM",
      "principalId": "A14F9C26-D030-4086-89C1-A402F6017FF1",
      "principalName": "Clint Hill",
      "managedObjectId": "7",
      "managedObjectVersion": "-1",
      "managedObjectStatus": "OFFERED",
      "parentObjectId": "pvm:0a123",
      "applicationActivityName": "ConfirmResolution",
      "applicationActivityInstanceId": "pvm:001i1s",
      "applicationName": "HelpDeskProcess",
      "additionalAttributes": {
        "attribute": [
          {
            "-xsi:type": "base:LongEntryAttribute",
            "-xmlns:base": "http://base.api.ec.n2.tibco.com",
            "-xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
            "attributeId": "146",
            "attributeName": "workItemPriority",
            "type": "LONG",
            "value": "50"
          },
          {
            "-xsi:type": "base:StringEntryAttribute",
            "-xmlns:base": "http://base.api.ec.n2.tibco.com",
            "-xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
            "attributeId": "152",
            "attributeName": "entities",
            "type": "STRING",
            "value": "_Jb8oYMpREd64gM7QE8RwxA	3	3"
          },
                 .
                 .
                 .
          {
            "-xsi:type": "base:StringEntryAttribute",
            "-xmlns:base": "http://base.api.ec.n2.tibco.com",
            "-xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
            "attributeId": "2",
            "attributeName": "environmentName",
            "type": "STRING",
            "value": "BPMEnvironment"
          }
        ]
      }
    },
    "workItemRef": { "workItemId": "7" }
  }
}