Code Monkey home page Code Monkey logo

toggl-to-freee-workload's Introduction

toggl track to freee workload

Toggl Track のデータを Google Sheets にエクスポートして、 freee工数管理 に登録する Google Sheets の Add-on。

clasp

Setup

次のコマンドでインストールする。 事前にGoogle App Script APIを有効にして clasp にログインしておくこと。

$ git clone https://github.com/HeRoMo/toggl-to-freee-workload.git
$ cd toggl-to-freee-workload
$ yarn install 
$ yarn clasp create --type sheets --rootDir src --title toggl-to-freee-workload
$ mv src/.clasp.json ./.clasp.json
$ yarn clasp:push

clasp create--title オプションの値は任意で構わない。

事前準備

freee アプリの作成

  1. freeeアプリストア にアクセスする
  2. 「新規追加」をクリックして新しいアプリを作成する
    • アプリ名:任意でOK
    • 概要:任意でOK
    • アプリタイプ:プライベートを選択
  3. 作成すると ClientIDClient Secret が発行される。
    • ClientIDClient Secret は後で使う。
    • コールバックURLはまだそのままでOK
  4. 権限設定で次の項目にはチェックを入れる
    • [人事労務] 勤怠: 参照のみでOK
    • [工数管理] 従業員
    • [工数管理] チーム
    • [工数管理] プロジェクト: 参照のみでOK
    • [工数管理] プロジェクト詳細
    • [工数管理] 従業員単価
    • [工数管理] 取引先
    • [工数管理] 工数:参照、更新ともにチェックする
  5. 設定したら保存する

GASアプリの設定

  1. スクリプトが関連づいているスプレッドシートを開く
    • yarn clasp open --addon を実行すると開く
  2. メニュー「拡張機能」の中にtoggl-to-freee-workloadという項目ができているのでそのサブメニューの「設定」を選択する
  3. 設定ダイアログが開くので各項目を入力して保存する。
    • Toggle のAPI トークンは toggl track のプロフィールからコピーして入力する
    • ClientIDClient Secret には先程作成した freee アプリの値を入力する
    • コールバックURLはコピーして先程の freee アプリのコールバックURLに入力する
  4. 入力したら「保存」する
  5. 再度設定ダイアログを開いて、ログインボタンをクリックする
  6. ダイアログが表示されるので「freeeの認証ページを開く」
  7. freee の認証ページで許可して、ブラウザのタブを閉じる
  8. 再度設定ダイアログを開いてログアウトボタンの横にログインユーザが表示されていれば成功ログイン成功

TOGGL_FREEE_MAP シートの作成

  1. 「拡張機能」のtoggl-to-freee-workload の「サイドバーを表示」を選択する
  2. サイドバーのTogglの「プロジェクト・タグを出力する」ボタンをクリックする
  3. TOGGL_PROJECTS_TAGS という名前のシートが作られ toggl のプロジェクトとタグの一覧が出力される
  4. freee工数管理の「プロジェクト・タグを出力する」ボタンをクリックする
  5. FREEE_PROJECTS_TAGS という名前のシートが作られ freee工数管理のプロジェクトとタグの一覧が出力される
    • 自分が参画していないプロジェクトも出力されることに注意
  6. TOGGL_FREEE_MAP という名前のシートを作成し、カラムヘッダとして1行目に次のカラム名を記入する
    • togglProjectId
    • togglProjectName
    • togglTagId
    • togglTagName
    • freeeProjectId
    • freeeProjectName
    • freeeTagGroupId
    • freeeTagGroupName
    • freeeTagId
    • freeeTagName
  7. TOGGL_PROJECTS_TAGS と FREEE_PROJECTS_TAGS を元にtogglとfreee工数管理のプロジェクト・タグ対照表を作成する

以上で準備は完了。

使い方

toggl データの出力

  1. togglデータを出力したいシートを選択する
  2. サイドバーを表示し toggl の workspace と 年月を選択して「読み出し」ボタンをクリックする
  3. シートに toggl のデータが出力されるので確認する
    • freeeTagGroupId、freeeTagGroupName、freeeTagId、freeeTagName が出力されていない行は toggl データのプロジェクト・タグの組み合わせが間違っているか TOGGL_FREEE_MAP が間違っているので修正する
    • freee工数管理のプロジェクト [その他]その他業務(開発以外) はタグがないので空白で構わない

freee工数管理へのデータ登録

  1. データを確認したらサイドバーの freee工数管理の「工数を登録」をクリックする
    • シートの内容が工数として登録される
  2. 工数 | freee工数管理 で登録した工数を確認する

Develop

Push the codes and open in web editor

You can push the codes to GAS by the following command.

$ yarn clasp:push

And you can open your GAS project in web editor by the following command.

$ yarn clasp:open

Linting

Run the following command, you can check the codes by ESLint.

$ yarn lint

Testing

Run the following command, you can test the codes by jest locally.

$ yarn test

LICENSE

MIT

libs

toggl-to-freee-workload's People

Contributors

renovate[bot] avatar heromo avatar

Watchers

 avatar

toggl-to-freee-workload's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/eslint.yml
  • actions/checkout v4
  • actions/setup-node v4
  • HeRoMo/pronto-action v1.66.0
.github/workflows/jest.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/upload-artifact v4
nodenv
.node-version
  • node 20.17.0
npm
package.json
  • typescript ^5.0.0
  • @eslint/eslintrc ^3.0.2
  • @eslint/js ^9.2.0
  • @google/clasp 2.4.2
  • @stylistic/eslint-plugin-ts ^2.0.0
  • @types/google-apps-script 1.0.83
  • @types/jest 29.5.12
  • @typescript-eslint/eslint-plugin 8.3.0
  • @typescript-eslint/parser 8.3.0
  • eslint ^9.2.0
  • eslint-import-resolver-typescript ^3.6.1
  • eslint-plugin-googleappsscript 1.0.5
  • eslint-plugin-import ^2.29.1
  • eslint-plugin-jest 28.8.0
  • globals ^15.1.0
  • jest 29.7.0
  • ts-jest 29.2.5
  • typescript-eslint ^8.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.