Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Clockwork API allows you to programmatically interacting with Clockwork data. For example, you could write automation to retrieve a list of worklogs at the end of every month and pass it into your invoicing service.

...

Code Block
https://api.clockwork.report/v1/worklogs?expand=issues,authors,emails,worklogs
Response

Contains an array of worklogs for the specified scope. You can use:

  • The expand=issues query parameter to expand the response with issue details like Summary or Custom Fields. Otherwise you will receive only the issueId.

  • The expand=authors to expand the response with author details like Display Name. Otherwise you will receive only the accountId of the user.

  • The expand=emails to expand response to include the worklog author’s email address.

  • The expand=worklogs query parameter will fetch issue ID, worklog ID, time spent, and worklog attributes such as tags and billable hours.

API endpoints

All endpoints are currently hosted under https://api.clockwork.report/v1. Add that prefix to each of the endpoints below.

...

Request query parameters
starting_at
date

The lower bound of the returned worklogs in the format of YYYY-MM-DD.

ending_at
date

The upper bound of the returned worklogs in the format of YYYY-MM-DD.

project_ids[]
integer
project_keys[]
string

Narrow down the returned worklogs to selected projects only. If both are provided,project_ids takes precedence over project_keys. Multiple values are allowed, i.e. project_keys[]=SSP&project_keys[]=SSPA

account_id
string
user_query
string
user_query[]
string

Narrow down the returned worklogs to the selected authors only. account_id takes precedence over user_query . user_query allows you to provide any kind of term that will be matched against possible authors. You can use it to provide a list of emailAddresses to query against, i.e:

  • user_query[]=alice@company.com&user_query[]=bob@company.com

expand
string

Comma-separated list of response parts to include. Currently supported expand item are: issues, authors and emails.

...

Code Block
curl 'https://api.clockwork.report/v1/worklogs' \
  --get \
  --data starting_at=2021-03-01 \
  --data ending_at=2021-03-31 \
  --data project_keys%5B%5D=SSP \
  --data account_id=5ba374cab1a6ab2f054f17b1 \
  --header 'Authorization: Token <TOKEN_HERE>'
Response

Contains an array of worklogs for the specified scope. You can use:

...

The expand=issues query parameter to expand the response with issue details like Summary or Custom Fields. Otherwise you will receive only the issue id.

...

The expand=authors to expand the response with author details like Display Name. Otherwise you will receive only the accountId of the user.

...

EXAMPLE RESPONSE
Code Block
[
  {
    "author": {
      "accountId": "5ba374cab1a6ab2f054f17b1"
    },
    "id": "10685",
    "issue": {
      "id": "10118"
    },
    "started": "2021-02-08T14:23:35Z",
    "timeSpentSeconds": 2700
  }
]

...

Status
colourRed
titleRequired

issue_id
integer
issue_key
string

Specify the issue you want to start a timer on. If both are provided, issue_id takes precedence over issue_key.

...

Status
colourRed
titleRequired

issue_id
integer
issue_key
string

Specify the issue you want to stop the timer on. If both are provided, issue_id takes precedence over issue_key.

...