A tool to move time entries from Toggl to PeopleSoft for Navigant Consulting.
Required: - usage of Toggl for time keeping (https://toggl.com/toggl-desktop/) - access to the Navigant RStudio cluster - enough time to change over your time codes to the format needed for NAVtrackr
Nice to have: - a little bit of coding experience - Pushover installed on your phone (https://pushover.net/)
Put these tokens into an .Renviron
file. This will set your keys as environment variables when R loads. Doing this is a little tricky because the .Renviron
file lives on your home directory on NFS so you can only access it through Rstudio or SSH.
a. To write this file using Rstudio, start a new R session no associated with any project (it should say "Project: (None)") on the top right hand side. Then use the file explorer to see if there is a file called .Renviron
. If so then open that up and edit it. Otherwise create a new R script and save it with the file name .Renviron
(protip: can also do this with an SSH client using the commands cd ~; vim .Renviron;
).
b. Write the following lines into .Renviron
TOGGL_TOKEN="<your toggl token>"
PUSHOVER_KEY="<your pushover key>"
c. Save and exit.
d. (Optional) create a NAVsecret vault so you don't need to enter your password to run NAVtrackr
:
library(NAVsecret)
create_nav_vault("your.email@navigant.com")
e. (Optional) you can set the permissions on this file such that only you can read it, if you're into that sort of thing. Just SSH in and run the chmod
command of your choice (probably chmod 711 .Renviron
). If you want to be 100% NAVhip, use the new NAVsecret
to do this :)
Grab a beer and change over your toggl project codes to a consistent format that NAVtrackr
can read. This is going to follow the format example cases:
[some text] [billcode]:[task]
[some text] [billcode]:[task1]:[task2]
[some text] [billcode1]:[task1]&[billcode2]:[task2] 80/20 (ratio specified)
[some text] [billcode1]:[task1]&[billcode2]:[task2] (ratio inferred as 50/50)
[some text] [billcode1]:[task1]&[billcode2]:[task2]&[billcode3]:[task3] 50/25/25
[some text] [billcode1]:[task1]&[billcode2]:[task2]&[billcode3]:[task3] (ratio inferred as 33/33/33)
This part is crucial. For the code, see the function get_toggl_entries().
More details:
If there is a single bill code, but there is more than one task you have two options:
SRP PM 123456:001:002
)SRP PM 123456:001&123456:002 60/40
)Specified ratios must be integers, but do not need to add up to 100. Can be 1/3 instead of 25/75.
Here are bad bill codes:
123456 task 001 Client X (wrong structure)
Client X split between 365158:567 and 379342:321 (' and ' instead of '&')
Client X savings 365158:567 & 379342:321 (spaces next to the '&')
Client X PM 213283:789&213283:732&213283:721 0.3/0.3/0.3 (ratio is not an integer)
Here are good bill codes:
Client X 123456:001
Client X PM 123456:001:002:003:004
Client X split between 365158:567&379342:321
Client X savings 365158:567&379342:321
Client X PM 213283:789&213283:732&213283:721 33/33/33
Now you are ready to run the scripts!
library(NAVtrackr)
report_create()
report_create(period_end_date = get_Sat(prev = F))
NAVtrackr
has pretty good error handling, but the one area that has issues is when you enter a time code that can be parsed but is not valid (see issue 3). This results in the following error:
Error in ts_fill_save(., entries, notify) :
Timesheet error: Invalid value -- press the prompt button or hyperlink for a list of valid values (15,11)The value entered in
the field does not match one of the allowable values. You can see the allowable values by pressing the Prompt button or
hyperlink.<a class=
When this happens to me I usually just go into InsideNCI and manually try out any new codes in a new timesheet to see if they exist.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.