Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
/ temposaurus Public archive

Temposaurus computes the running total of overtime in Tempo.

License

Notifications You must be signed in to change notification settings

olliefr/temposaurus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Temposaurus

Temposaurus computes the running total of overtime from the data pulled from Tempo, the embedded time tracking tool for Jira.

Getting started

Temposaurus uses two REST APIs:

Thus before starting Temposaurus you'll need to set up the access tokens for those APIs.

Jira Cloud access token

Authentication with Jira Cloud API requires setting up basic auth access to your Atlassian account.

Tempo access token

Authentication with Tempo API requires setting up a bearer access token to your Tempo data. The required scopes are Periods and Approvals. See Using the REST API as an individual user.

Compiling Temposaurus

Checkout the repo and go build.

Running Temposaurus

Temposaurus is a CLI application which is controlled via environment variables.

Temposaurus recognises the following environmental variables.

Mandatory
JIRA_EMAIL Email address you use to login to Tempo
ATLASSIAN_TOKEN Jira Cloud API access token
TEMPO_TOKEN Tempo API access token
DATE_FROM Start date

 

Optional
JIRA_DOMAIN Your company's subdomain at .atlassian.com. Defaults to the first subdomain of your email address. That is the email address [email protected] defaults to verifa.
DATE_TO Finish date. The default value is the current date.
HTTP_TIMEOUT REST API client timeout in seconds. The default value is 30 seconds.

The dates do not have to fall on the accounting period boundary as the correct boundaries will be computed, inclusive of both FROM and TO dates. The date format is yyyy-mm-dd, such as 2020-10-27.

Example

This is how I query the data for every week since my first week at work:

[email protected] \
TEMPO_TOKEN=$(cat ~/.tempo_secret) \
ATLASSIAN_TOKEN=$(cat ~/.atlassian_secret) \
DATE_FROM=2020-10-01 \
DATE_TO=2021-04-25 \
./temposaurus

temposaurus-screenshot

Beware that your current (unapproved) timesheet may skew the result greatly, so choose the DATE_TO value wisely.

Docker image

The Docker image is available from the Docker Hub: olliefr/temposaurus.

This is how I use it:

docker pull olliefr/temposaurus
sudo docker container run --rm -it -e [email protected] -e ATLASSIAN_TOKEN=$(cat ~/.tokens/atlassian) -e TEMPO_TOKEN=$(cat ~/.tokens/tempo) -e DATE_FROM=2021-04-12 olliefr/temposaurus

TODO

  • GitHub Releases
  • Docker image built via goreleaser or Docker Hub Actions

Contributing

To avoid frustration the following are the rules of engagement for Temposaurus.

:shipit:
Issues Please read the It doesn't work essay before submitting an issue.
PRs Please raise an issue to discuss first.
Forks Yes, please, as much as you'd like.

License

Apache License 2.0

Releases

No releases published

Packages

No packages published