项目迭代 API

  1. Tier: 专业版, 旗舰版
  2. Offering: JihuLab.com, 私有化部署

本文档描述了项目迭代的 API。另有一个单独的群组迭代 API页面。

我们不再提供项目级别的迭代,但您可以使用此端点来获取项目祖先群组的迭代。

列出项目迭代#

返回项目迭代的列表。

通过启用自动调度迭代节奏中创建的迭代会在titledescription字段中返回null

plaintext
1GET /projects/:id/iterations 2GET /projects/:id/iterations?state=opened 3GET /projects/:id/iterations?state=closed 4GET /projects/:id/iterations?search=version 5GET /projects/:id/iterations?include_ancestors=false 6GET /projects/:id/iterations?include_descendants=true 7GET /projects/:id/iterations?updated_before=2013-10-02T09%3A24%3A18Z 8GET /projects/:id/iterations?updated_after=2013-10-02T09%3A24%3A18Z
属性类型必需描述
statestring返回openedupcomingcurrentclosedall迭代。
searchstring仅返回标题与提供的字符串匹配的迭代。
inarray of strings模糊搜索应在其中执行的字段,使用参数search给出的查询。可用选项有titlecadence_title。默认值为[title]。在极狐GitLab 16.2 中引入。
include_ancestorsboolean包含父群组及其祖先的迭代。默认为true
include_descendantsboolean包含父群组及其后代的迭代。默认为false。在极狐GitLab 16.7 中引入。
updated_beforedatetime仅返回在给定日期时间之前更新的迭代。预期为 ISO 8601 格式(2019-03-15T08:00:00Z)。在极狐GitLab 15.10 中引入。
updated_afterdatetime仅返回在给定日期时间之后更新的迭代。预期为 ISO 8601 格式(2019-03-15T08:00:00Z)。在极狐GitLab 15.10 中引入。

示例请求:

shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/iterations"

示例响应:

json
1[ 2 { 3 "id": 53, 4 "iid": 13, 5 "group_id": 5, 6 "title": "Iteration II", 7 "description": "Ipsum Lorem ipsum", 8 "state": 2, 9 "created_at": "2020-01-27T05:07:12.573Z", 10 "updated_at": "2020-01-27T05:07:12.573Z", 11 "due_date": "2020-02-01", 12 "start_date": "2020-02-14", 13 "web_url": "http://gitlab.example.com/groups/my-group/-/iterations/13" 14 } 15]