This project is not covered by Drupal’s security advisory policy.

About

TogMine synchronizes time log entries from Toggl.com to Redmine using a Drush command.

Audience

TogMine is for professional services organisations that use Toggl.com to track time, and Redmine to track issues (tickets) in a project, make estimates and monitor actuals to estimates.

TogMine is the missing link; It takes time entry data from Toggl.com's API and imports it into Redmine. This allows estimates to be compared to actuals very accurately and quickly, without needing to double-enter time logs or retrieve data from different systems.

Dependencies

TogMine requires the Toggl.com API and Redmine API modules to interact with data from each respective service/software. It also requires Drush to execute a synchronisation. A graphical user interface may be added in the future.

TogMine 1.x works with Redmine 1.0 and 1.1 and connects directly to Redmine's database.

TogMine 2.x uses Redmine API module version 2.x which uses Redmine's REST API instead of a database connection, and thus should work more consistently across any future version of Redmine.

Installation & Usage

TogMine requires that Toggl time entries include a reference to the Redmine ticket number, e.g. "#123 Fixed the foo bar", or "Worked on #123 and #124, but mostly #123". In the latter case it will take the time for the Toggl task, round it according to the rounding configuration (defaults to 15 minute blocks), then divide it into 2/3 for ticket #123 and 1/3 for ticket #124. It does not yet alert users of time entries which are being ignored, though this is a desirable feature at this point.

TogMine uses Drupal core profile fields managed by Redmine User Access Keys and Toggl.com User tokens modules to build a map of Redmine-to-Toggl.com API access tokens.

TogMine is a Drupal 6 module and collection of Drush commands:

  • togmine-push-projects; Synchronises projects from Redmine to Toggl, new in v2
  • togmine-push-issues; Synchronises open issues in each project from Redmine to Toggl as an "autocomplete suggestion" (a zero-duration time entry) in Toggl, new in v2
  • togmine-pull-time-entries; Synchronises time log entries from Toggl to Redmine. Known as togmine-synchronize in TogMine version 1.

Only togmine-pull-time-entries is necessary to pull time from Toggl into Redmine. The other two commands enhance the user experience in Toggl.com by making it easier to find Redmine issue numbers and create time entries that reference them.

You can have togmine synchronise on crontab for daily synchronisation or even every 5 minutes. E.g.

MAILTO="notifications@example.com"

# m h  dom mon dow   command
# Pull time entries every day at 5:11am.
11 05 * * * /usr/local/bin/drush --root=/var/www/intranet.example.com/ togmine-pull-time-entries

# Synchronise projects and issues every hour.
41 * * * * /usr/local/bin/drush --root=/var/www/intranet.example.com/ togmine-ush-projects; /usr/local/bin/drush --root=/var/www/intranet.example.com/ togmine-push-issues

Configuration

TogMine does not have a GUI yet (that is on the roadmap, but not yet a high priority) and is only configurable through $conf in settings.php. See function togmine_var() in togmine.module and consider overriding these variables. All times are in seconds;

togmine_rounding_block
What time block should toggl tasks be rounded to? Must be a positive integer (not zero).
Defaults to 15 minutes: 15 * 60
togmine_rounding_threshold
TogMine rounds up unless the last time block is smaller than the threshold. Must be a non-negative integer (zero is okay).
Defaults to 1 minute: 1 * 60,
togmine_backlog_period
The backlog period to synchronize tasks.
Defaults to 2 weeks: 2 * 7 * 24 * 60 * 60,
togmine_debug
Puts TogMine into debug mode. Recommended
Defaults to FALSE -- no extra debug output: FALSE
toggl_toggl_workspace_id
The Toggl workspace ID to filter tasks by. You can get this from a raw user or time_entries API response:
Defaults to FALSE, causing the workspace ID to be ignored -- no filtering: FALSE
Note that by setting this, push-projects only executes once for the entire Drupal site. It assumes that all Drupal users are using and sharing that Toggl workspace.
Also note that this variable is in Toggl.com API module's namespace, not togmines. And is thus not documented in togmine_var().
togmine_redmine_default_activity
The ID of the default activity of Redmine time entries. Defaults to 8, the default activity in Redmine out of the box.
autocomplete_suggestion_tag_name
The name of the tag that is used for time entries which are autocomplete suggestions for Redmine tickets.
Defaults to "Redmine suggestion". Something shorter is usually desirable.

Warning about v1.x

Because TogMine version 1.x writes directly to Redmine's database, this module may break your Redmine data. Back up your Redmine data, use with caution and test thoroughly. Version 2 is recommended for new installs. There is currently no upgrade path from version one to two.

Development

There is some documentation on setting up development sandboxes to build TogMine and it's dependencies.

Related modules

Commercial support

The author of this module is available for hire. Contact Bevan.

Attribution

This module was originally developed by Palantir.net.

Project information

  • Module categories: Integrations
  • Created by Bevan on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases