task_history_event list_worktime#

Description#

タスク履歴イベントから作業時間の一覧を出力します。 「作業中状態から休憩状態までの作業時間」など、タスク履歴より詳細な作業時間の情報を出力します。

日ごとユーザーごとの作業時間を確認する場合は、 annofabcli statistics list_worktime を参照してください。

Examples#

JSON出力#

$ annofabcli task_history_event list_worktime --project_id prj1 --format pretty_json --output out.json
out.json#
[
{
    "project_id": "prj1",
    "task_id": "task1",
    "phase": "annotation",
    "phase_stage": 1,
    "account_id": "user1",
    "user_id": "user1",
    "username": "user1",
    "worktime_hour": 0.6420147222222222,
    "start_event": {
        "task_history_id": "17724ca4-6cdd-4351-86e6-16c19d50233e",
        "created_datetime": "2021-05-20T13:37:52.281+09:00",
        "status": "working"
    },
    "end_event": {
        "task_history_id": "c22ec069-a6a9-42f9-8438-53bd6145b91f",
        "created_datetime": "2021-05-20T14:16:23.534+09:00",
        "status": "complete"
    },
    "end_event_request": {
        "status": "complete",
        "force": false,
        "account_id": "user1",
        "user_id": "user1",
        "username": "user1"
    }

}
]

出力結果の主要な項目の説明#

  • worktime_hour : 作業時間(単位は時間)

  • start_event : 作業開始イベントの情報

    • task_history_id : 作業開始イベントのID

    • created_datetime : 作業開始イベントの作成日時

    • status : 作業開始イベントのステータス。常に working です。

  • end_event : 作業終了イベントの情報

    • task_history_id : 作業終了イベントのID

    • created_datetime : 作業終了イベントの作成日時

    • status : 作業終了イベントのステータス。 complete , break , on_hold のいずれかです。

  • end_event_request : 作業終了イベントが発行された operateTask APIのリクエスト情報

    • status : タスクのステータス

    • force : 強制操作(強制差し戻しなど)かどうか

    • account_id, user_id, username : 担当者のユーザー情報

CSV出力#

$ annofabcli task_history_event list_worktime --project_id prj1 --output out.csv
out.csv#

project_id

task_id

phase

phase_stage

account_id

user_id

username

worktime_hour

start_event.task_history_id

start_event.created_datetime

start_event.status

end_event.task_history_id

end_event.created_datetime

end_event.status

end_event_request.status

end_event_request.force

end_event_request.account_id

end_event_request.user_id

end_event_request.username

prj1

task1

annotation

1

user1

user1

user1

0.944927777777778

415782a4-9704-4e41-89c4-edf16b3cecbc

2021-05-25T11:13:45.78+09:00

working

ee3923f9-73a9-49a5-ae91-e8edbecaa3df

2021-05-25T12:10:27.52+09:00

break

break

False

user1

user1

user1

prj1

task1

annotation

1

user1

user1

user1

0.059168888888889

f78cf574-f792-48ed-9333-72dfc8af9ae6

2021-05-25T12:11:17.063+09:00

working

2c1fcbbd-ba9d-4ed6-b616-b388458bd2d6

2021-05-25T12:14:50.071+09:00

break

break

False

user1

user1

user1

Usage Details#

タスク履歴イベントから作業時間の一覧を出力します。 タスク履歴より詳細な作業時間の情報を出力します。

usage: annofabcli task_history_event list_worktime [-h] [--yes]
                                                   [--endpoint_url ENDPOINT_URL]
                                                   [--annofab_user_id ANNOFAB_USER_ID]
                                                   [--annofab_password ANNOFAB_PASSWORD]
                                                   [--annofab_pat ANNOFAB_PAT]
                                                   [--logdir LOGDIR]
                                                   [--disable_log] [--debug]
                                                   -p PROJECT_ID
                                                   [-t TASK_ID [TASK_ID ...]]
                                                   [-u USER_ID [USER_ID ...]]
                                                   [--task_history_event_json TASK_HISTORY_EVENT_JSON]
                                                   [-f {csv,json,pretty_json}]
                                                   [-o OUTPUT]

Named Arguments#

-p, --project_id

対象のプロジェクトのproject_idを指定します。

-t, --task_id

対象のタスクのuser_idを指定します。 file:// を先頭に付けると、task_idの一覧が記載されたファイルを指定できます。

-u, --user_id

絞り込み対象のユーザのuser_idを指定します。 file:// を先頭に付けると、user_idの一覧が記載されたファイルを指定できます。

--task_history_event_json

タスク履歴イベント全件ファイルパスを指定すると、JSONに記載された情報を元にタスク履歴イベント一覧を出力します。 指定しない場合は、タスク履歴イベント全件ファイルをダウンロードします。 JSONファイルは $ annofabcli task_history_event download コマンドで取得できます。

-f, --format

Possible choices: csv, json, pretty_json

出力フォーマットを指定します。

Default: 'csv'

-o, --output

出力先のファイルパスを指定します。未指定の場合は、標準出力に出力されます。

global optional arguments#

--yes

処理中に現れる問い合わせに対して、常に yes と回答します。

--endpoint_url

Annofab WebAPIのエンドポイントを指定します。

Default: 'https://annofab.com'

--annofab_user_id

Annofabにログインする際のユーザーID

--annofab_password

Annofabにログインする際のパスワード

--annofab_pat

Annofabにログインする際のパーソナルアクセストークン

--logdir

ログファイルを保存するディレクトリを指定します。

Default: .log

--disable_log

ログを無効にします。

--debug

HTTPリクエストの内容やレスポンスのステータスコードなど、デバッグ用のログが出力されます。