Automates the population of your Tempo Timesheet
This tool reads a provided yaml file containing the day of the week, tickets worked on, and how much time (in hours) was spent on it.
Example:
---
2022-06-01:
- ticket: ABC-123
time: 1
- ticket: ABC-245
time: 1
- ticket: ABC-549
time: 6
Provided the above yaml file, this will populate the time in Tempo in order of the provided tickets. Time starts at 00:00:00, for each item worked on, the tool will offset the time by however long the previous ticket was, in the above example:
ABC-123 was started at 00:00:00 on 2022-06-01, and an hour was spent working on it.
ABC-245 was started at 00:01:00 on 2022-06-01, and an hour was spent working on it.
ABC-549 was started at 00:02:00 on 2202-06-01, and 6 hours was spent working on it.
Multiple days can be provided.
Example:
---
2022-06-01:
- ticket: ABC-123
time: 1
- ticket: ABC-245
time: 1
- ticket: ABC-549
time: 6
2022-06-02:
- ticket: ABC-123
time: 1
- ticket: ABC-245
time: 1
- ticket: ABC-549
time: 6
...
The tool is a "desired" state, which means that the config file is treated as the source of truth which means:
- It will for each day check for the current state from the API
- It will for each day compare the file data with what was returned in (1)
- If differences exist it will delete the items on that day
- It will populate the timesheet as described in the yaml file
The dryrun
flag can be passed to the populate
command in order to see differences prior to populating.
How to install:
pip install -r requirements.txt
In the case that you have entered work into Tempo, and want to pull it down in your config file, you can use the dump
command, and can redirect standard out to a file, date format should be in YYYY-MM-DD
format
workbook.py dump --apikey <api key generated in tempo> --accountid <account ID> --startdate <startdate> --enddate <enddate>
Once you are ready to populate Tempo, you can use the populate
command to apply the yaml config file, you may also use the optional dryrun
flag, which will not apply the changes, but show the differences.
workbook.py populate --apikey <api key generated in temp> --accountid <account ID> --input <yaml file> (--dryrun)
To get a Tempo API key:
Go to Tempo>Settings, scroll down to Data Access and select API integration.
To get your Account ID (atlassian):
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-myself/#api-group-myself
I used the developer tools while in JIRA to get the Account ID from one of the requests.