SummaryReport Documentation - team filter?

I am trying to get a breakdown of time used by a specific team broken down in time per client.
By setting the summaryFilter.Groups to “CLIENT”, I am able to get the breakdown, but I cannot see how I can filter for a specific team.
Simply trying to insert a string into the userGroup of the request body gave an error, and I cannot see anywhere how I can achieve this.
Ideas, anyone?

Bonus question:
There are a lot of fields in the report requests that are not populated with values in the API documentation that I can see at https://clockify.me/developers-api.
Does a documentation of all the possible fields in the request body exist somewhere or is it planned?

Hi Niels! You can group the summary report by 3 levels, so, for example, you can first group by user group then by client.

 "summaryFilter": {
    "groups": [
      "USER_GROUP",
      "CLIENT",
      "TIMEENTRY",
    ], (PROJECT, CLIENT, TASK, TAG, DATE, USER, USER_GROUP, TIMEENTRY)

Or you can use filters to filter for specific user groups by their id.

"userGroups": {
    "ids": [
    ] },

The request example from the documentation has all the fields, you can see the example for how to filter by user group from the user, or tags part of the example.

{
  "dateRangeStart": "2020-05-10T00:00:00.000Z",
  "dateRangeEnd": "2020-05-17T23:59:59.000Z",
  "users": {
    ids: ["45fd36c4b0798777049512e2", "5hdd36c4b0798777049512e2"],
    contains: "CONTAINS", (CONTAINS, DOES_NOT_CONTAIN)
    status: "ALL" (ALL, ACTIVE, INACTIVE)
  },
  "userGroups": null,
  "clients": null,
  "projects": null,
  "tasks": null,
  "tags": {
    ids: ["24fd36c4b0798777049512sa"],
    contains: "CONTAINS", (CONTAINS, DOES_NOT_CONTAIN, CONTAINS_ONLY)
    status: "ALL" (ALL, ACTIVE, ARCHIVED)
  },
  "billable": true,
  "description": "Filter description",
  "withoutDescription": true,
  "summaryFilter": {
    "groups": [
      "USER",
      "DATE",
      "TIMEENTRY",
    ], (PROJECT, CLIENT, TASK, TAG, DATE, USER, USER_GROUP, TIMEENTRY)
    "sortColumn": "GROUP" (GROUP, DURATION, AMOUNT)
  },
  "sortOrder": "DESCENDING", (ASCENDING, DESCENDING)
  "exportType": "JSON", (JSON, CSV, XLSX, PDF)
  "rounding": false,
  "amountShown": "HIDE_AMOUNT", (HIDE_AMOUNT, EARNED, COST, PROFIT)
  "customFields": [
    {
      "id": "5bfd36c4b0798777049512e2",
      "value": 30,
      "type": "NUMBER", (TXT, NUMBER, DROPDOWN_SINGLE, DROPDOWN_MULTIPLE, CHECKBOX, LINK)
      "numberCondition": "EQUAL", (GREATER_THAN, EQUAL, LESS_THAN)
      "empty": "false"
    }
  ]
}
1 Like

Thanks a lot! :smiley:

I have not found the userGroups explanation anywhere, so this is very helpful.
If I had read the documentation more carefully, I would probably have found the notion of the report levels, only slightly embarrassed by that…

Thanks again :+1:

1 Like