The Harvest Notifier app is an integration between Harvest and Slack which automatically reminds users who forget to mark their working hours in Harvest.
- This is a Ruby 3.3.5 application.
- Meant for installation on Heroku triggered by Daily Heroku Scheduler.
- Notification is determined by time data from the Harvest V2 API.
There are two types of reports: Daily and Weekly.
- The Daily Report is generated on all weekdays (except Monday) and shows those users who did not fill in their time for that day.
- The Weekly Report is generated every Monday and shows those users who still need to report the required working hours for previous week.
This app integration allows:
- Configure a whitelist of Harvest users who don't need to be notified in Slack.
- Mention users in the Slack channel.
- Quickly report the working hours from the included link.
- Refresh report results.
- Set up a custom report schedule.
-
Create a Personal Access Token on Harvest.
-
Create a Slack app. You may want to follow the official guide.
-
Add the following scopes to OAuth & Permissions > Bot Token Scopes:
chat:write users:read users:read.email
-
Install the App to your Workspace.
- Generates a Bot User OAuth Token.
The easiest way to deploy this app is to use the Heroku button.
# heroku config:set [email protected]
# EMAILS_WHITELIST is a list of emails separated by commas, which don't need to be notified in Slack.
heroku config:set HARVEST_ACCOUNT_ID=harvest-account-id
heroku config:set HARVEST_TOKEN=harvest-token
# HARVEST_URL is the link used when clicking on the "Report Time" button in Slack.
heroku config:set HARVEST_URL=https://augustash.harvestapp.com/time
# MISSING_HOURS_THRESHOLD indicates the minimum threshold of hours at which the employee will not be notified in Slack.
heroku config:set MISSING_HOURS_THRESHOLD=4.0
heroku config:set SLACK_CHANNEL=slack-notifications-channel
heroku config:set SLACK_TOKEN=slack-bot-user-oauth-token
heroku config:set [email protected], [email protected], [email protected]
# ROLLBAR_ACCESS_TOKEN is a token for Rollbar error tracking.
# heroku config:set ROLLBAR_ACCESS_TOKEN=rollbar-access-token
# DEADMANSSNITCH_API_KEY is a token for Dead Man Snitch to monitor Heroku Scheduler runs.
# heroku config:set DEADMANSSNITCH_API_KEY=dead-mean-snitch-access-token
heroku addons:create deadmanssnitch:the-lone-snitch -a <app-name>
heroku addons:create rollbar:trial-5k -a <app-name>
heroku addons:create scheduler:standard -a <app-name>
bin/rake reports:daily
for daily reportbin/rake reports:weekly
for weekly report
For more fine-grained control, edit the Clockfile
and enable a clock dyno:
heroku ps:scale clock=1 -a <app-name>
bin/quality
based on RuboCop.rubocop.yml
describes active checks
git clone [email protected]:augustash/harvest-notifier.git
cd harvest-notifier
docker build -t heroku-notifier .
docker run -it -v .:/app --rm heroku-notifier /bin/bash
bin/setup
bin/build
It was written by Flatstack with the help of our contributors.