Get Task Report (Historic)

Retrieves a report of completed tasks. When the report type is set to count, the report contains a list of completed task counts where an entry contains the task name, the definition key of the task, the process definition id, the process definition key, the process definition name and the count of how many tasks were completed for the specified key in a given period. When the report type is set to duration, the report contains a minimum, maximum and average duration value of all completed task instances in a given period.

Method

GET /history/task/report

Parameters

Query Parameters

Name Description
reportType Mandatory. Specifies the kind of the report to execute. To retrieve a report about the duration of process instances the value must be set to duration. For a report of the completed tasks in a specific timespan the value must be set to count.
periodUnit When the report type is set to duration, this parameter is Mandatory. Specifies the granularity of the report. Valid values are month and quarter.
completedBefore Restrict to tasks that were completed before the given date. By default*, the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g., 2013-01-23T14:42:45.000+0200.
completedAfter Restrict to tasks that were completed after the given date. By default*, the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g., 2013-01-23T14:42:45.000+0200.
groupBy When the report type is set to count, this parameter is Mandatory. Groups the tasks report by a given criterion. Valid values are taskName and processDefinition.

Result for count Report Type

A JSON array of historic task report objects. Each historic task report object has the following properties:

Name Value Description
taskName String The task name of the task. It is only available when the groupBy-parameter is set to taskName. Else the value is null.
processDefinitionId String The id of the process definition.
processDefinitionKey String The key of the process definition.
processDefinitionName String The name of the process definition.
count Long The number of tasks which have the given definition.

Result for duration Report Type

A JSON array of duration report result objects. Each object has the following properties:

Name Value Description
period Number Specifies a span of time within a year.
Note: The period must be interpreted in conjunction with the returned periodUnit.
periodUnit String The unit of the given period. Possible values are MONTH and QUARTER.
maximum Number The greatest duration in milliseconds of all completed task instances, which have been completed in the given period.
minimum Number The smallest duration in milliseconds of all completed task instances, which have been completed in the given period.
average Number The average duration in milliseconds of all completed task instances, which have been completed in the given period.

Response Codes

Code Media type Description
200 application/json Request successful.
400 application/json Returned if some of the query parameters are invalid, for example if a completedAfter parameter is supplied, but the date format is wrong. See the Introduction for the error response format.

Example

Request for completed task report

GET /history/task/report?reportType=count&groupBy=processDefinition

Response

[
  {
    "taskName" : null,
    "processDefinitionId" : "aProcessDefinitionId",
    "processDefinitionKey" : "aProcessDefinitionKey",
    "processDefinitionName" : "A Process Definition Name",
    "count" : 42
  },
  {
    "taskName" : null,
    "processDefinitionId" : "anotherProcessDefinitionId",
    "processDefinitionKey" : "anotherProcessDefinitionKey",
    "processDefinitionName" : "Another Process Definition Name",
    "count" : 9000
  }
]

Request for duration report

GET /history/task/report?reportType=duration&periodUnit=quarter

Response

[
  {
    "period": 1,
    "periodUnit": "QUARTER",
    "maximum": 500000,
    "minimum": 250000,
    "average": 375000
  },
  {
    "period": 2,
    "periodUnit": "QUARTER",
    "maximum": 600000,
    "minimum": 300000,
    "average": 450000
  },
  {
    "period": 3,
    "periodUnit": "QUARTER",
    "maximum": 1000000,
    "minimum": 500000,
    "average": 750000
  },
  {
    "period": 4,
    "periodUnit": "QUARTER",
    "maximum": 200000,
    "minimum": 100000,
    "average": 150000
  }
]

On this Page: