# プロジェクトのタスク一覧

`GET /api/project/{projectId}/task`

URL: https://repsona.com/ja/api/get-project-projectid-task

プロジェクトのタスクをページ送りで返します。parent_id にタスク ID を指定するとサブタスク一覧、root を指定すると最上位のタスクだけになります。parent_id 指定時は木の並び順 (sortOrder)、省略時は ID 順です。カンマ区切りの ID 絞り込みは、いずれかに一致するものを返します。

## パラメーター

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `projectId` | path | integer | 必須 | プロジェクトの ID です。 |
| `page` | query | integer |  | ページ番号 (1 から) |
| `limit` | query | integer |  | 1 ページの件数 (500 件まで) |
| `parent_id` | query | "root" \| integer |  | タスク ID を渡すとそのサブタスクだけ、`root` を渡すと最上位のタスクだけを返します。省略するとプロジェクトのすべてのタスクを返します。 |
| `closed` | query | true \| false |  | `true` で完了したタスクだけ、`false` で未完了のタスクだけを返します。省略するとどちらも返します。 |
| `status_ids` | query | string |  | ステータス ID のカンマ区切りです。いずれかのステータスのタスクを返します。 |
| `milestone_ids` | query | string |  | マイルストーン ID のカンマ区切りです。いずれかのマイルストーンのタスクを返します。 |
| `tag_ids` | query | string |  | タグ ID のカンマ区切りです。いずれかのタグが付いたタスクを返します。 |
| `responsible_user_ids` | query | string |  | ユーザー ID のカンマ区切りです。いずれかのユーザーが担当のタスクを返します。 |
| `ball_holder_ids` | query | string |  | ユーザー ID のカンマ区切りです。いずれかのユーザーがボールを持っているタスクを返します。 |

## リクエスト

```sh
curl -X GET "https://<space>.repsona.com/api/project/{projectId}/task" \
  -H "Authorization: Bearer $REPSONA_API_KEY"
```

## レスポンス

- 200: { tasks, page, limit, hasMore }
- 400: Invalid query parameters
- 401: Authentication is required
- 403: Not a project member
- 404: Project not found

## レスポンスの例

```json
{
  "tasks": [
    {
      "id": 100442,
      "parentId": null,
      "projectId": 296,
      "responsibleUserId": 1127,
      "ballHoldingUserId": 1127,
      "statusId": 196,
      "milestoneId": 38,
      "sortOrder": null,
      "statusBoardSortOrder": null,
      "priorityBoardSortOrder": null,
      "responsibleUserBoardSortOrder": null,
      "ballHoldingUserBoardSortOrder": null,
      "milestoneBoardSortOrder": null,
      "name": "Write release notes for v2.0",
      "planned": null,
      "actual": null,
      "priority": 2,
      "extra": null,
      "startDate": 1794182400000,
      "dueDate": 1794614400000,
      "createdAt": 1793662651065,
      "updatedAt": 1793662651113,
      "deletedAt": null,
      "tagIds": [
        90
      ],
      "description": "Summarize the changes in the new website for the **launch announcement**."
    }
  ],
  "page": 1,
  "limit": 20,
  "hasMore": false
}
```
