Git Product home page Git Product logo

toggl's Introduction

Redmine Toggl Plugin

This plugin enables Redmine to fetch Toggl time entries and register them as issues’ time entries.

Developed by: Ivan Kasatenko <[email protected]>

How to setup

Tested on Redmines:

  • 2.3.1

  • 3.1.1

Tested on Rubies:

  • 1.9.3

  • 2.2.3

So, here’s the gist of the setup process:

$ cd /path/to/redmine/plugins
$ git clone git://github.com/SkyWriter/toggl.git
$ RAILS_ENV=production bundle exec rake redmine:plugins:migrate
$ crontab -e

Then add the following line to your crontab (schedule may vary, of course):

59 23 * * * cd /path/to/redmine && RAILS_ENV=production bundle exec rake toggl:update

IMPORTANT: You should have default activity set in your Redmine. It could be found at your.redmine.com/enumerations address under the “Activities” section.

How to use

First, go to your Redmine profile and set your Toggl API key. You can get one at www.toggl.com/app/profile. If you want to use only some of your Toggl workspaces, you can set them up in Redmine as a comma separated string. To fetch entries from all workspaces, just leave workspace setting empty.

After that any entry in Toggl marked with a hash and a number goes to the corresponding task in your projects. For example, an entry “Going out with Sarah #1324” of 2.5 hours will add 2.5h to the issue #1324 with the “Going out with Sarah” comment.

You can edit that entry in Redmine or even delete it, it won’t be overwritten or repopulated ever again.

Any Toggl records without a hash are skipped.

Warranties

None, as usual :) It’s a quick in-house hack, so don’t come crying if it ever breaks or even kills your puppy with its gross gears.

It’s unlikely, but you have been warned.

License

This plugin is released under the MIT License, www.opensource.org/licenses/MIT.

toggl's People

Contributors

skywriter avatar vsulak avatar zaburt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

toggl's Issues

toggle with redmine 3.0.1.stable

Trying to use this plugin with my redmine installation. Followed the steps and its now working. Not sure what im supposed to submit here so i leave my redmine enviroment.

Environment:
Redmine version 3.0.1.stable
Ruby version 2.2.0-p0 (2014-12-25) [x86_64-linux]
Rails version 4.2.0
Environment production
Database adapter Mysql2

Activity can't be blank

Getting the error "Activity can't be blank" when doing the update.

Is activity a premium feature in Toggl?

Redmine 2.2.3.stable.11530 - fix to 002_create_api_key_field.rb:

Hi!

When I try install your plugin, I was find small error.
After when you will try RAILS_ENV=production ... you could see this error.

002_create_api_key_field.rb:5: syntax error, unexpected ':', expecting ']'

The solution to resolve them :

002_create_api_key_field.rb
class CreateApiKeyField < ActiveRecord::Migration

def up
custom_field = CustomField.new_subclass_instance('UserCustomField', {
:name => 'Toggl API Key',
:field_format => 'string',
:min_length => 32,
:max_length => 32,
:regexp => '',
:default_value => '',
:is_required => 0,
:visible => 1,
:editable => 1,
:is_filter => 0
})
custom_field.save!
end

def down
CustomField.find_by_name('Toggl API Key').destroy
end

end

redmine 3.1.0 support?

Hi,
Just curious if this plugin will support 3.1.0 anytime soon? I've installed the toggl plugin to test it on the latest stable redmine 3.1.0, but the place to enter the toggl api key does not show within the redmine user account.

thanks!

Filtering by Project

Would it be possible to also filter time records by project(pid)? Same way as it is possible to filter by work-spaces(wid)?

This would really help in case when different toggl projects are tracked with different tools (github, gitlab etc.) and we want to exclude to avoid conflicts

BTW: Thanks for this plugin!

Redmine 3.4.4.stable compatibility

I see that the README clearly states that the plugin is Only tested on Redmine 2.3.1 and Ruby 1.9.3.

Are there any plans for compatibility with the latest version of Redmine? The plugin doesn't show up on the Plugins page 😞

Change Activity

Is it somehow possible to use toggl text as activity?
That would require that the passed toggl text is already a redmine-activity

Example

  1. Redmine: There is already an activity XY
  2. Toggl: Creating entry "XY # 1, project, begin-time, end-time
  3. Redmine: Create entry for issue # 1, activity XY

Edit Togle issue

Is it possible to edit Redmine logTime when someone edit the Togle entry?

Couldn't find Issue with id=XXX

Hi, I have a problem with creating a new time entry.
When I run rake toggl:update RAILS_ENV=production, I get rake aborted! Couldn't find Issue with id=XXX
That is right. Issue with number XXX doesn't exist in redmine. But is it necessary to get en error and stop creating all other time entries?

I don't know Ruby, so sorry for missing patch.
I guess, there could be a condition testing missing redmine issue in the create_time_entry(), before TimeEntry.new() is called, or error handling for Issue.find(). Don't know.
Thank you, good job.

Multiple Redmines

Would it be possible to have a configuration option so the the plugin can handle multiple redmines?

Some
thing like #A123 for one Redmine #B123 for a second and so on. So the plugin could optionally look for a non numeric value after the # key.

Dave

Support for "duronly" entries.

Toggl has a setting that allows users to pause and resume time entries. Those time-entries then don't get a "stop"-time. Due to the filter in this plugin those time entries are ignored even though they are completed.

Currently I'm using a condition like ((!entry["stop"].nil? && !entry["stop"].empty?) || (entry["duronly"] && !entry["duration"].empty?)) to get all the time entries, but I'm unsure whether this is the best approach.

Unfinished Toggl Entries Trigger an Error

If rake toggl:update RAILS_ENV=production is run when there are unfinished time entries in Toggl, it fails with the message "Validation failed: Hours is invalid".

Steps to reproduce:

  1. Start a time entry in Toggl with a valid ticket number (#1234, etc.).
  2. Run rake toggl:update RAILS_ENV=production; this will fail with "Validation failed: Hours is invalid".
  3. Stop the timer in Toggl.
  4. Rerun rake toggl:update RAILS_ENV=production; everything should now work fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.