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.

...

This endpoint retrieves the list of worklogs, and can be scoped with query parameters to narrow the response.

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

items are: worklogs,issues, authors and emails.

Adding the expand=worklogs request parameter returns worklog properties, including worklog attributes. This part of the response looks like this:

Code Block
"properties": [
            {
                "key": "clockwork",
                "value": {
                    "ignore_time_logged_validator_processing": true,
                    "attributes": [
                        {
                            "key": "lsu5rn3s"
                        },
                        {
                            "key": "lsu5tfek",
                            "value": true
                        },
                        {
                            "key": "lusfr0zh"
                        }
                    ],
                    "tracking_mode": "manual"
                }
            }
        ]

the attributes can be identified by navigating to Apps>Clockwork, then Settings>Worklogs and opening the Edit worklog attribute dialog. The key is displayed at the bottom of the dialog, like this:

image-20240503-161523.pngImage Added
EXAMPLE CURL
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>'

...

This endpoint starts your timer for a given issue.

Request query parameters
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.

EXAMPLE CURL
Code Block
curl 'https://api.clockwork.report/v1/start_timer' \
  --request POST \
  --data issue_key=SSP-13 \
  --header 'Authorization: Token <TOKEN_HERE>'

...

This endpoint stops a running timer for a given issue.

Request query parameters
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.

EXAMPLE CURL
Code Block
curl 'https://api.clockwork.report/v1/stop_timer' \
  --request POST \
  --data issue_key=SSP-13 \
  --header 'Authorization: Token <TOKEN_HERE>'

...