{{< details >}}
- Tier: 专业版, 旗舰版
- Offering: JihuLab.com, 私有化部署
{{< /details >}}
本文档描述了项目迭代的 API。另有一个单独的群组迭代 API页面。
我们不再提供项目级别的迭代,但您可以使用此端点来获取项目祖先群组的迭代。
列出项目迭代
返回项目迭代的列表。
通过启用自动调度在迭代节奏中创建的迭代会在title
和description
字段中返回null
。
GET /projects/:id/iterations
GET /projects/:id/iterations?state=opened
GET /projects/:id/iterations?state=closed
GET /projects/:id/iterations?search=version
GET /projects/:id/iterations?include_ancestors=false
GET /projects/:id/iterations?include_descendants=true
GET /projects/:id/iterations?updated_before=2013-10-02T09%3A24%3A18Z
GET /projects/:id/iterations?updated_after=2013-10-02T09%3A24%3A18Z
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
state |
string | 否 | 返回opened 、upcoming 、current 、closed 或all 迭代。 |
search |
string | 否 | 仅返回标题与提供的字符串匹配的迭代。 |
in |
array of strings | 否 | 模糊搜索应在其中执行的字段,使用参数search 给出的查询。可用选项有title 和cadence_title 。默认值为[title] 。在极狐GitLab 16.2 中引入。 |
include_ancestors |
boolean | 否 | 包含父群组及其祖先的迭代。默认为true 。 |
include_descendants |
boolean | 否 | 包含父群组及其后代的迭代。默认为false 。在极狐GitLab 16.7 中引入。 |
updated_before |
datetime | 否 | 仅返回在给定日期时间之前更新的迭代。预期为 ISO 8601 格式(2019-03-15T08:00:00Z )。在极狐GitLab 15.10 中引入。 |
updated_after |
datetime | 否 | 仅返回在给定日期时间之后更新的迭代。预期为 ISO 8601 格式(2019-03-15T08:00:00Z )。在极狐GitLab 15.10 中引入。 |
示例请求:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/iterations"
示例响应:
[
{
"id": 53,
"iid": 13,
"group_id": 5,
"title": "Iteration II",
"description": "Ipsum Lorem ipsum",
"state": 2,
"created_at": "2020-01-27T05:07:12.573Z",
"updated_at": "2020-01-27T05:07:12.573Z",
"due_date": "2020-02-01",
"start_date": "2020-02-14",
"web_url": "http://gitlab.example.com/groups/my-group/-/iterations/13"
}
]