项目迭代 API

本页描述项目迭代 API。这儿有单独的群组迭代 API页面。

我们没有项目级迭代,但您可以使用此端点获取项目上级群组的迭代。

列出项目迭代

返回项目迭代的列表。

迭代节奏中通过 启用自动调度 来创建的迭代返回 null 作为 titledescription 字段。

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 返回 openedupcomingcurrent (previously started)closedall 迭代。从 14.1 版本开始不推荐使用 started 状态过滤,请改用 current
search string 仅返回标题与提供的字符串匹配的迭代。
include_ancestors boolean 包括来自父组及其祖先的迭代。默认为 true
in array of strings no 在这些字段中,应该使用参数 search 中给定的查询进行模糊搜索。可用的选项为 titlecadence_title。默认为 [title]。引入于 16.2。
include_descendants boolean no 包含父群组和其子群组的迭代。默认为 false。引入于 16.7。
updated_before datetime no 仅返回特定日期之间创建的迭代。期望的格式是(2019-03-15T08:00:00Z)。引入于 15.10。
updated_after datetime no 仅返回特定日期之后创建的迭代。期望的格式是(2019-03-15T08:00:00Z)。引入于 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"
  }
]