Coder Social home page Coder Social logo

togglsync's Introduction

TogglSync

TogglSync is an app for one way synchronizing toggl entries to:

  • redmine time entries associated with issues.
  • jira work log associated with Jira issue

All toggl entries decorated with issue id (see example) will be treated as entries to send to redmine time entries.

Optionally after synchronization this app sends a notification to mattermost.

Tracking entries in Toggl

Add a time entry in Toggl and give it a comment:

  • Tracing bug for #345 (for redmine issue #345)
  • New time entry XYZ-123 (for Jira issue XYZ-123)

Running a synchronizer will insert a redmine time entry with comment Tracing bug for #345 [toggl#0000] at issue #345. [toggl#0000] is a time entry decorator added by synchronizer to track unique toggl time entry id.

Time entry description must contain redmine issue id or jira issue slug in a proper format defined in config file.

Requirements

  • Toggl account and api key
  • For Redmine integration:
    • Redmine URL
    • Redmine account and api key
  • For Jira integration:
    • Jira URL
    • Jira username and password
  • [Optional] Mattermost incoming webhook url

How to run

  • Download pack from releases tab.
  • Unpack ZIP package
  • Copy config.yml.example to config.yml
  • Edit config.yml

On Windows:

  • Run synchronizer.exe file with parameters

On Mac OS X / Unix:

  • Prepare environment (see Advanced chapter)
  • Run script from python (see Advanced chapter)
  • Optionally prepare runnable script
    • use examples/togglsync_last_day_simulation (for OS X)
    • make file executable:
      chmod u+x examples/togglsync_last_day_simulation
      
    • edit the command parameters in file to run sync with proper attributes
    • rename file accordingly

Examples

Get help:

synchronizer --help

Run synchronizer for today:

synchronizer -d 0

Run synchronizer for today in simulation mode (no changes will be made):

synchronizer -d 0 -s

Mattermost

After synchronization a summary may be send to mattermost. In order to send notification you have to fill mattermost incoming webhook url in config.yml. After that synchronizer will send an short summary to mattermost.

You can also request synchronizer to post a message to particular channel. For that you have to fill channel key in config.yml. If you want to receive a message on default incoming webhook channel, remove this key from config.yml.

channel key in config.yml can be also a list and TogglSync will send a message to every specified channel. If you want to send a message to a particular channel and to default channel, add an empty channel and this particular one to channel list:

  channel: ["", "#channell"]

Advanced

Prepare environment

On Unix/OS X:

cd (to repo root)
virtualenv -p python3 .env (osx)
python3 -m pip install --upgrade pip
source .env/bin/activate
pip install -r requirements.txt

On Windows:

cd (to repo root)
python -m venv .env
python -m pip install --upgrade pip
.env\Scripts\activate.bat
pip install -r requirements.txt

Run script from python

On Unix/OS X:

cd (to repo root)
source .env/bin/activate
export PYTHONPATH=.
python togglsync/synchronizer.py --help

On Windows:

cd (to repo root)
.env\Scripts\activate.bat
set PYTHONPATH=.
python togglsync/synchronizer.py --help

Run tests

nosetests -v

Run tests with coverage

nosetests --with-coverage --cover-package togglsync

Prepare executable

pyinstaller --onefile --icon=icon.ico synchronizer.spec

Change log

0.5.1

  • Integration with Jira

0.5.2

  • Implemented rounding (to minutes) for Jira
  • Skipping zero-length entries
  • Added colors to console output
  • Added --errors switch and simplified error message
  • Added example script for OS X

togglsync's People

Contributors

yaras avatar stan-czajka avatar elubik avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

kermit1313

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.