Skip to content

kruc/toggl-to-jira

Repository files navigation

toggl-to-jira

What is toggl-to-jira?

Toggl-to-jira is an application which allows you to migrate toggl time entries into multiple jira instances.

How it works?

Toggl-to-jira takes toggl time entries from the given time period and it creates workloads in related jira issues. To work properly each toogle timeentry has to be assigned to the client. Base on this assignment and app configuration, application recognize in which jira instance should create workloads.

Installation

MacOS Homebrew:

brew install kruc/homebrew-tap/toggl-to-jira

Linux

 wget -qO- https://github.com/kruc/toggl-to-jira/releases/download/v0.7.1/toggl-to-jira_0.7.1_Linux_x86_64.tar.gz | tar -xvz -C /usr/local/bin && chmod +x /usr/local/bin/toggl-to-jira

Requirements

  1. Toggl time entries naming convention

    [JIRA-ISSUE-ID] [WORKLOAD DESCRIPTION]
    e.g. ISSUE-123 Description of what has been done
    
    https://jira.atlassian.net/browse/ISSUE-123
    

    [JIRA-ISSUE-ID] - issue matching

    [WORKLOAD DESCRIPTION] - jira workload description

  2. Assign client to every time entry you want to migrate

    jira instance matching is based on client

First run

  1. Run toggl-to-jira without parameters
toggl-to-jira

it will generate configuration at $HOME/.toggl-to-jira/config.yaml

default_client:
  jira_client_user: firstname.lastname
  jira_host: https://jira.atlassian.net
  jira_password: (visit https://id.atlassian.com/manage/api-tokens)
  jira_username: [email protected]
  stachursky_mode: 1
jira_migration_failed_tag: jira-migration-failed
jira_migration_skip_tag: jira-migration-skip
jira_migration_success_tag: logged
log_format: text
log_output: stdout
period: 1
toggl_token: (visit https://www.toggl.com/app/profile)
  1. Adjust following keys:

    • default_client.jira_client_user
    • default_client.jira_host
    • default_client.jira_password
    • default_client.jira_username
    • toggl_token
  2. Run again to check what time entries will be considered

    toggl-to-jira
    
    INFO[0000] Checking configuration...
    INFO[0000] Customize configuration in file: /Users/jacekciwis/.toggl-to-jira/config.yaml
    INFO[0000] Start processing 1478671803: ISSUE-123 Work description
    51m32s - toggl value
    52m0s - stachursky mode (1m)
    
    Workload details:
    Time spent: 50m0s
    Comment: ISSUE-123 Work description
    Issue url: https://jira.atlassian.net/browse/ISSUE-123
    
  3. Configuration for missing clients will be autogenerated

    client:
      client_foo:
        enabled: true
        jira_host: https://foo.atlassian.net
      client_bar:
        enabled: true
      centraleyes:

    You can overwrite default_client configuration here

  4. If everything is correct, run with the --apply flag

    toggl-to-jira --apply
    INFO[0000] Checking configuration...
    INFO[0000] Customize configuration in file: $HOME/.toggl-to-jira/config.yaml
    INFO[0000] Start processing 1478671803: ISSUE-123 Work description
    INFO[0001] Jira workload added
    INFO[0001] Add logged tag
    INFO[0001] Issue url: https://jira.atlassian.net/browse/ISSUE-123
    INFO[0002] Finish processing 1478671803: ISSUE-123 Work description
  5. After migration success toggl time entry will be tag with jira_migration_success_tag configuration key value (default: logged) - this tag causes skip on next migration

  6. If you want to skip some time entry migration, tag it with jira_migration_skip_tag configuration key value (default: jira-migration-skip)

  7. After migration fail toggl time entry will be tag with jira_migration_failed_tag configuration key value (default: jira-migration-failed) - this tag will be remove after migration success