Giter Site home page Giter Site logo

axalian / toggl-jira Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 4.0 2.95 MB

A sync tool to log time logged in Toggl to Jira issues

License: BSD 3-Clause "New" or "Revised" License

PHP 98.57% Smarty 0.75% Dockerfile 0.41% Shell 0.27%
toggl jira toggl-api jira-issue-tracker zf3 jira-issue sync

toggl-jira's Introduction

TogglJira

Scrutinizer Code Quality Build Status

A sync tool to log time logged in Toggl to Jira issues. It works awesomely with the Toggl Chrome plugin.

Usage

TogglJira expects Toggl entries to start with the JIRA issue ID, for example:

SUP-11 Support the Customer Service department

It will then add a WorkLog entry to issue SUP-11.

Copy config.json.dist to config.json. Fill in your details. Leave jiraLoginUsername as an empty string if your login username and username are the same, which might not be the case with JIRA Cloud and Atlassian ID. The fillIssueID and fillIssueComment keys can also be left blank if not needed. The notifyUsers key controls whether JIRA will send an email to people watching the issue when adding or updating time entries.

Then run:

php bin/toggljira.php help

or to start syncing:

php bin/toggljira.php sync [--startDate=] [--endDate=] [--overwrite=] 
  • By default the startDate is the last sync date from config.json or today.
  • By default the endDate is now.
  • By default worklogs will be combined (merged) and not overwritten.

Custom start and end date

This will sync all worklogs starting from today.

php bin/toggljira.php sync --startDate=today

This will sync all worklogs starting from 1 january 2018.

php bin/toggljira.php sync --startDate=2018-01-01

This will sync all worklogs starting from 1 january 2018 to 1 february 2018.

php bin/toggljira.php sync --startDate=2018-01-01 --endDate=2018-02-01

Overwriting existing worklogs instead of combining (merging)

This will sync all worklogs starting from 1 january 2018 to 1 february 2018 and it will overwrite existing worklogs.

php bin/toggljira.php sync --startDate=2018-01-01 --endDate=2018-02-01 --overwrite=true

That's it, enjoy!

Bonus: Running with Docker

A docker-compose.yml file is included in the repository. If you are familiar with Docker Compose, you can use this to run the script without having to configure PHP locally.

The code gets mounted to /usr/src/toggl-jira in the Docker container, so you can run it with:

docker-compose run --rm php php bin/toggljira.php sync --startDate=yesterday

You can also install Composer dependencies like this, which ensures they get installed in a PHP 7.1 environment. You can ignore the git warnings; it will still work:

# NOTE: At least on Linux, this will cause the vendor files to be owned by root if your user is in the Docker group. You will have to delete them with sudo if you need to later on.

docker-compose run --rm php composer install

Thanks

I couldn't have done it without the help of Timon Bolier and from the community, wizonesolutions for his Docker implementation :)

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.