Retrieves a single filter by id, according to the Filter interface in the engine.

Method

GET /filter/{id}

Parameters

Path Parameters

Name Description
id The id of the filter to be retrieved.

Query Parameters

Name Description
itemCount If set to true, each filter result will contain an itemCount property with the number of items matched by the filter itself.

Result

A JSON object corresponding to the Filter interface in the engine.Its properties are as follows:

Name Value Description
id String The id of the filter.
resourceType String The resource type of the filter, e.g., Task.
name String The name of the filter.
owner String The user id of the owner of the filter.
query Object The save query of the filter as JSON object.
properties Object The properties of the filter as JSON object.
itemCount Long The number of items matched by the filter itself. Note: Only exists if the query parameter itemCount was set to true

Response Codes

Code Media type Description
200 application/json Request successful.
403 application/json The authenticated user is unauthorized to read this filter. See the Introduction for the error response format.
404 application/json Filter with given id does not exist. See the Introduction for the error response format.

Example

Request

GET /filter/aFilterId

Response

Status 200.

  1. {
  2. "id": "9917d731-3cde-11e4-b704-f0def1e59da8",
  3. "name": "Accounting Tasks",
  4. "owner": null,
  5. "properties": {
  6. "color": "#3e4d2f",
  7. "description": "Tasks assigned to group accounting",
  8. "priority": 5
  9. },
  10. "query": {
  11. "candidateGroup": "accounting"
  12. },
  13. "resourceType": "Task"
  14. }

Request with ItemCount Enabled

GET /filter/aFilterId?itemCount=true

Response with ItemCount

Status 200.

  1. {
  2. "id": "9917d731-3cde-11e4-b704-f0def1e59da8",
  3. "name": "Accounting Tasks",
  4. "owner": null,
  5. "properties": {
  6. "color": "#3e4d2f",
  7. "description": "Tasks assigned to group accounting",
  8. "priority": 5
  9. },
  10. "query": {
  11. "candidateGroup": "accounting"
  12. },
  13. "resourceType": "Task",
  14. "itemCount": 23
  15. }

原文: https://docs.camunda.org/manual/7.9/reference/rest/filter/get/