Sync timesheets between Harvest and Targetprocess
npm install -g twotime
Once installed, you need to authenticate against Harvest and Targetprocess.
twotime auth
You will need:
- Harvest personal access token and account ID
- Targetprocess username and password
If you're using Windows and WSL, you may wish to be able to use twotime in either environment. To avoid having two separate authentication configurations you can symlink the configuration files.
Windows and WSL example
Assuming you've already installed and authenticated your Windows installation of twotime, then head to WSL:
-
Install
twotime
in WSL$ npm -g i twotime
-
symlink the configs, substituting
USER_NAME
with the value from%USERNAME%
in your Windows environment$ mkdir -p ~/.config/configstore $ ln -s /mnt/c/Users/USER_NAME/.config/configstore/twotime.json ~/.config/configstore/twotime.json $ twotime list [INFO] Getting config from /home/JohnDoe/.config/configstore/twotime.json ╔═══════════════╤══════════════════════════╤═════════════╤════════╗ ║ Entity Type │ Title │ Hours │ Status ║
Please ensure you've authenticated (see Setup) before using twotime
.
- Use
twotime start
to start a timer - Use
twotime finish
to finish a timer - Use
twotime pause
to pause the currently running timer - Use
twotime resume
to resume a paused timer
Use twotime list
to see a summary of a days timesheet.
Most commands can be used with past timesheets. You can provide a --date
option (or -d
for short):
twotime start --date 2018-10-20
Or an offset with --offset
(or -o
for short) - the number of days in the past e.g. offset of 1 is yesterday
twotime start -o 1
Provide the --all
option to finish all of a day's timers at once.
Use the --tp
option to start a timer without prompting for a Targetprocess ID:
twotime start --tp 12345
When a time entry for a TargetProcess Issue
is finished, time is booked on the relevant TargetProcess entity based on the value of custom field IssueTime to
on the TargetProcess project. Values for this custom field can be as below:
User story
- Issue time is booked on the user story. If the issue is not attached to a user story, no time is booked on TargetProcess.Issue
- Issue time is booked to the issue.none
- No issue time is booked on TargetProcess.
When a time entry for a TargetProcess Task
is finished, if the time remaining on the task is 0, then it is moved to Done
state.
Made with 💖 by NewOrbit in Oxfordshire, and licensed under the MIT Licence