Skip to content
generated from fs/ruby-base

Remind users about missing reports in Slack.

License

Notifications You must be signed in to change notification settings

fs/harvest-notifier

Repository files navigation

Slack Reminder

Build Status Deploy

Slack Reminder is an integration between Harvest and Slack which automatically reminds users who forget to mark their working hours in Harvest.

This is a Ruby 2.6.5 library for installation on Daily Heroku Scheduler. Notification is determined from Harvest API V2.

Features

There are 2 types of reports: Daily and Weekly.

  • Daily Report is generated on weekdays (except Monday) and shows those users who did not fill in their time for that day.

  • Weekly Report is generated every Monday and shows those users who still need to report the required working hours for last week.

This integration allows to:

  • mention users in the Slack
  • refresh report result
  • quickly report the working hours from the link
  • set up custom report schedule
  • configure a whitelist which consists of users, who don't need to be notified in Slack

Example

Quick Start

  1. Prepare access tokens
  • Create Personal Access Tokens on Harvest.

  • Create Slack app. You can find official guide here.

  • Create Bot User OAuth Access Token

  • Add following scopes to Bot:

    chat:write
    users:read
    users:read.email
  • Add app to Slack channel.

  1. Deploy to Heroku

  2. Configure following ENV variables

    heroku config:set HARVEST_TOKEN=harvest-token
    heroku config:set HARVEST_ACCOUNT_ID=harvest-account-id
    heroku config:set SLACK_TOKEN=slack-bot-token
    heroku config:set SLACK_CHANNEL=slack-channel
    heroku config:set [email protected], [email protected], [email protected]
    # EMAILS_WHITELIST is a variable that lists emails separated by commas, which don't need to be notified in Slack.
    # For example, administrators or managers.
    heroku config:set MISSING_HOURS_THRESHOLD=1.0
    # MISSING_HOURS_THRESHOLD is a variable that indicates the minimum threshold of hours at which the employee will not be notified in Slack.
    # For example, 2.5 or 4. The default threshold is 1 hour. Leave empty if satisfied with the default value.
  3. Add job in Heroku Scheduler

  • bin/rake reports:daily for daily report
  • bin/rake reports:weekly for weekly report

Support

If you have any questions or suggestions, send an issue, we will try to help you

Quality tools

  • bin/quality based on RuboCop
  • .rubocop.yml describes active checks

Develop

  1. Сlone repo
git clone [email protected]:fs/harvest-notifier.git
cd harvest-notifier
  1. Setup project
bin/setup
  1. Check specs and run quality tools
bin/build

Credits

It was written by Flatstack with the help of our contributors.

About

Remind users about missing reports in Slack.

Resources

License

Stars

Watchers

Forks

Releases

No releases published